Skip to content

Commit 22578ce

Browse files
committed
[tests] Alter test data and update tests
Alter test data to accomodate cases for deleted files results Signed-off-by: inishchith <inishchith@gmail.com>
1 parent 8b9345a commit 22578ce

7 files changed

Lines changed: 15 additions & 10 deletions

File tree

tests/data/graaltest.zip

32 Bytes
Binary file not shown.

tests/test_cocom.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def test_fetch(self):
119119
self.assertFalse('parents' in commit['data'])
120120
self.assertFalse('refs' in commit['data'])
121121

122+
cc = CoCom('http://example.com', self.git_path, self.worktree_path)
123+
commits = [commit for commit in cc.fetch()]
124+
125+
self.assertEqual(len(commits), 6)
126+
122127

123128
class TestFileAnalyzer(TestCaseAnalyzer):
124129
"""FileAnalyzer tests"""

tests/test_codep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_fetch(self):
9090
cd = CoDep('http://example.com', self.git_path, self.worktree_path, entrypoint="perceval")
9191
commits = [commit for commit in cd.fetch()]
9292

93-
self.assertEqual(len(commits), 3)
93+
self.assertEqual(len(commits), 6)
9494
self.assertFalse(os.path.exists(cd.worktreepath))
9595

9696
commit = commits[0]

tests/test_colang.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_fetch_linguist(self):
9191
cl = CoLang('http://example.com', self.git_path, tag="test")
9292
commits = [commit for commit in cl.fetch()]
9393

94-
self.assertEqual(len(commits), 3)
94+
self.assertEqual(len(commits), 6)
9595
self.assertFalse(os.path.exists(cl.worktreepath))
9696

9797
commit = commits[0]
@@ -106,7 +106,7 @@ def test_fetch_cloc(self):
106106
cl = CoLang('http://example.com', self.git_path, tag="test")
107107
commits = [commit for commit in cl.fetch(category=CATEGORY_COLANG_CLOC)]
108108

109-
self.assertEqual(len(commits), 3)
109+
self.assertEqual(len(commits), 6)
110110
self.assertFalse(os.path.exists(cl.worktreepath))
111111

112112
commit = commits[0]

tests/test_coqua.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_fetch_pylint(self):
9898
self.worktree_path, entrypoint="perceval")
9999
commits = [commit for commit in cq.fetch()]
100100

101-
self.assertEqual(len(commits), 3)
101+
self.assertEqual(len(commits), 6)
102102
self.assertFalse(os.path.exists(cq.worktreepath))
103103

104104
commit = commits[0]
@@ -121,7 +121,7 @@ def test_fetch_flake8(self):
121121
commits = [commit for commit in cq.fetch(
122122
category=CATEGORY_COQUA_FLAKE8)]
123123

124-
self.assertEqual(len(commits), 3)
124+
self.assertEqual(len(commits), 6)
125125
self.assertFalse(os.path.exists(cq.worktreepath))
126126

127127
commit = commits[0]

tests/test_covuln.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_fetch(self):
9090
cd = CoVuln('http://example.com', self.git_path, self.worktree_path, entrypoint="perceval")
9191
commits = [commit for commit in cd.fetch()]
9292

93-
self.assertEqual(len(commits), 3)
93+
self.assertEqual(len(commits), 6)
9494
self.assertFalse(os.path.exists(cd.worktreepath))
9595

9696
commit = commits[0]

tests/test_graal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def test_fetch_no_analysis(self):
247247
graal = Graal('http://example.com', self.git_path, self.worktree_path)
248248
commits = [commit for commit in graal.fetch()]
249249

250-
self.assertEqual(len(commits), 3)
250+
self.assertEqual(len(commits), 6)
251251
self.assertFalse(os.path.exists(graal.worktreepath))
252252

253253
for commit in commits:
@@ -261,7 +261,7 @@ def test_fetch_analysis(self):
261261
mocked = MockedGraal('http://example.com', self.git_path, self.worktree_path)
262262
commits = [commit for commit in mocked.fetch()]
263263

264-
self.assertEqual(len(commits), 3)
264+
self.assertEqual(len(commits), 6)
265265
self.assertFalse(os.path.exists(mocked.worktreepath))
266266

267267
commit = commits[0]
@@ -762,7 +762,7 @@ def test_items(self):
762762
items = graal.graal.fetch(CommandBackend, args, CATEGORY_MOCKED)
763763
items = [item for item in items]
764764

765-
self.assertEqual(len(items), 3)
765+
self.assertEqual(len(items), 6)
766766
for i in items:
767767
self.assertEqual(i['category'], CATEGORY_MOCKED)
768768

@@ -778,7 +778,7 @@ def test_items_no_category(self):
778778
items = graal.graal.fetch(CommandBackend, args, None)
779779
items = [item for item in items]
780780

781-
self.assertEqual(len(items), 3)
781+
self.assertEqual(len(items), 6)
782782
for i in items:
783783
self.assertEqual(i['category'], CATEGORY_MOCKED)
784784

0 commit comments

Comments
 (0)