示例#1
0
 def test_missing(self):
     try:
         load_file(
             'test-data/1.2/missing_resource/resources.json')
         self.fail("Expected load failure b/c of missing file")
     except IOError:
         pass
示例#2
0
 def test_missing(self):
     with pytest.raises(IOError):
         load_file('test-data/1.2/missing_resource/resources.json')
示例#3
0
 def test_processor(self):
     uut = load_file('test-data/1.2/simple/resources.json',
                     processors=[TestProcessor()])
     self.assertEqual('1.2', uut['swaggerVersion'])
     self.assertTrue(uut['processed'])
示例#4
0
 def test_simple(self):
     uut = load_file('test-data/1.2/simple/resources.json')
     self.assertEqual('1.2', uut['swaggerVersion'])
     decl = uut['apis'][0]['api_declaration']
     self.assertEqual(1, len(decl['models']))
     self.assertEqual(1, len(decl['models']['Simple']['properties']))
示例#5
0
 def test_processor(self):
     uut = load_file('test-data/1.2/simple/resources.json',
                     processors=[TestProcessor()])
     self.assertEqual('1.2', uut['swaggerVersion'])
     self.assertTrue(uut['processed'])
示例#6
0
 def test_simple(self):
     uut = load_file('test-data/1.2/simple/resources.json')
     self.assertEqual('1.2', uut['swaggerVersion'])
     decl = uut['apis'][0]['api_declaration']
     self.assertEqual(1, len(decl['models']))
     self.assertEqual(1, len(decl['models']['Simple']['properties']))