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
def test_missing(self): with pytest.raises(IOError): load_file('test-data/1.2/missing_resource/resources.json')
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'])
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']))
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'])
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']))