@@ -20,12 +20,12 @@ def __getattr__(self, attr):
20
20
21
21
22
22
class Arguments (object ):
23
- path = 'xenon'
23
+ path = [ 'xenon' ]
24
24
url = 'http://api.barium.cc/jobs'
25
25
repo_token = 'abcdef1234569abdcef'
26
26
service_job_id = '4699301'
27
27
service_name = 'travis-ci' ,
28
- config = os .path .join (path , '.xenon.yml' )
28
+ config = os .path .join (path [ 0 ] , '.xenon.yml' )
29
29
exclude = None
30
30
ignore = None
31
31
no_assert = False
@@ -73,7 +73,7 @@ def testCheck(self):
73
73
@parametrized (
74
74
# results
75
75
# absolute, average, modules, averagenum
76
- # exit code
76
+ # infractions
77
77
(
78
78
{'mod.py' : [4 , 12 , 8 , 9 ], 'mod2.py' : [3 , 3 , 2 , 10 ]},
79
79
('C' , 'B' , 'B' , None ),
@@ -112,23 +112,23 @@ def testCheck(self):
112
112
(
113
113
{'mod.py' : [4 , 12 , 8 , 9 ], 'mod2.py' : [3 , 3 , 2 , 10 ]},
114
114
(None , None , None , 0 ),
115
- 0
115
+ 1
116
116
),
117
117
)
118
- class RunTestCase (unittest .TestCase ):
118
+ class InfractionsTestCase (unittest .TestCase ):
119
119
120
- def setParameters (self , results , args , exit_code ):
120
+ def setParameters (self , results , args , infractions ):
121
121
r = {}
122
122
for k , v in results .items ():
123
123
r [k ] = [dict (name = 'block' , complexity = cc , lineno = 1 ) for cc in v ]
124
124
self .r = r
125
125
self .args = Args (* args )
126
126
self .logger = CatchAll ()
127
- self .exit_code = exit_code
127
+ self .infractions = infractions
128
128
129
129
def test_run (self ):
130
- code = core .find_infractions (self .args , self .logger , self .r )
131
- self .assertEqual (code != 0 , self .exit_code )
130
+ infr = core .find_infractions (self .args , self .logger , self .r )
131
+ self .assertEqual (infr , self .infractions )
132
132
133
133
134
134
class APITestCase (unittest .TestCase ):
0 commit comments