File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ def check_file_txt(self, path):
238238
239239 # yanglint
240240 set_coverage_checking (False ) # we can't count the following as it may or may not be run, depending on setup
241- if settings .SUBMIT_YANGLINT_COMMAND :
241+ if settings .SUBMIT_YANGLINT_COMMAND and os . path . exists ( settings . YANGLINT_BINARY ) :
242242 cmd_template = settings .SUBMIT_YANGLINT_COMMAND
243243 command = [ w for w in cmd_template .split () if not '=' in w ][0 ]
244244 cmd_version = VersionInfo .objects .get (command = command ).version
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ def submit_new_wg(self, formats):
266266
267267 self .assertContains (r , 'xym' )
268268 self .assertContains (r , 'pyang' )
269- if settings .SUBMIT_YANGLINT_COMMAND :
269+ if settings .SUBMIT_YANGLINT_COMMAND and os . path . exists ( settings . YANGLINT_BINARY ) :
270270 self .assertContains (r , 'yanglint' )
271271
272272 q = PyQuery (r .content )
@@ -1249,11 +1249,11 @@ def test_submit_invalid_yang(self):
12491249 m = q ('#yang-validation-message' ).text ()
12501250 for command in ['xym' , 'pyang' , 'yanglint' ]:
12511251 version = VersionInfo .objects .get (command = command ).version
1252- if command != 'yanglint' or settings .SUBMIT_YANGLINT_COMMAND :
1252+ if command != 'yanglint' or ( settings .SUBMIT_YANGLINT_COMMAND and os . path . exists ( settings . YANGLINT_BINARY )) :
12531253 self .assertIn (version , m )
12541254 self .assertIn ("draft-yang-testing-invalid-00.txt" , m )
12551255 self .assertIn ("error: syntax error: illegal keyword: ;" , m )
1256- if settings .SUBMIT_YANGLINT_COMMAND :
1256+ if settings .SUBMIT_YANGLINT_COMMAND and os . path . exists ( settings . YANGLINT_BINARY ) :
12571257 self .assertIn ("No validation errors" , m )
12581258
12591259
Original file line number Diff line number Diff line change 4545from ietf .utils .test_utils import TestCase
4646
4747skip_wiki_glue_testing = False
48- skip_message = ""
48+ skip_message_svn = ""
49+ skip_message_trac = ""
4950try :
5051 import svn # pyflakes:ignore
5152except ImportError as e :
5253 skip_wiki_glue_testing = True
53- skip_message = "Skipping trac tests: %s" % e
54- print (" " + skip_message )
54+ skip_message_svn = "Skipping trac tests: %s" % e
55+ print (" " + skip_message_svn )
56+
57+ if sys .version_info .major == 3 :
58+ skip_version_trac = True
59+ skip_message_trac = "Skipping trac tests: Trac not available for Python3 as of 14 Jul 2019, 04 Jul 2020"
60+ print (" " + skip_message_trac )
5561
5662class SendingMail (TestCase ):
5763
@@ -282,8 +288,8 @@ def test_500_page(self):
282288 r = self .client .get (url )
283289 self .assertTemplateUsed (r , '500.html' )
284290
285- @skipIf (sys . version_info . major == 3 , "Trac not available for Python3 as of 14 Jul 2019" )
286- @skipIf (skip_wiki_glue_testing , skip_message )
291+ @skipIf (skip_version_trac , skip_message_trac )
292+ @skipIf (skip_wiki_glue_testing , skip_message_svn )
287293class TestWikiGlueManagementCommand (TestCase ):
288294
289295 def setUp (self ):
You can’t perform that action at this time.
0 commit comments