Пример #1
0
class test_getRegionName(unittest.TestCase):
    
    def setUp(self):
        
        self.queries = SDEQueries()
        
    def tearDown(self):
        pass

    def test_FOO(self):
        self.assertEqual('foo'.upper(), 'FOO')
        
    def test_returns_string(self):
        self.assertIsInstance(self.queries.getRegionName(10000054), str)
    
    def test_not_return_None(self):
        region = "Jita"
        with self.assertRaises(TypeError):
            self.queries.getRegionID(region)
    
    def test_rejects_strings(self):
        region = "Jita"
        with self.assertRaises(AssertionError):
            self.queries.getRegionName("Metropolis")
            self.queries.getRegionName("Adam")
            self.queries.getRegionName("Devoid ")
Пример #2
0
class test_getRegionID(unittest.TestCase):
    
    def setUp(self):
        
        self.queries = SDEQueries()
        
    def tearDown(self):
        pass

    def test_FOO(self):
        self.assertEqual('foo'.upper(), 'FOO')
        
    def test_returns_integer(self):
        self.assertIsInstance(self.queries.getRegionID("Molden Heath"), int)
    
    def test_not_return_None(self):
        region = "Jita"
        with self.assertRaises(TypeError):
            self.queries.getRegionID(region)
    
    def test_rejects_numbers(self):
        with self.assertRaises(AssertionError):
            self.queries.getRegionID(12)
            self.queries.getRegionID(-12)
            self.queries.getRegionID(12.0)
            self.queries.getRegionID(-12.0)