Ejemplo n.º 1
0
class ViewTests(unittest.TestCase):

    def setUp(self):
        self.inspector = LogInspector(tests_assets.get_sample_allowed_patterns())
    
    #def tearDown(self):
        #testing.tearDown()

    def test_listtypes(self):
        """
        Testing if the retrieved code types are correct according to the get_sample_allowed_patterns()
        The codes must be truncate to 3 characters
        """
        types = tests_assets.get_sample_types()
        self.assertEqual(types, self.inspector.listtypes())

    def test_listtypeindexes(self):
        """
        Testing if the retrieved code types and your respective contexts are correct according to 
        the get_sample_allowed_patterns()
        """
        types = tests_assets.get_sample_types_index()
        self.assertEqual(types, self.inspector.listtypeindexes())

    def test_getitem(self):
        """
        Testing the log access retrieve from a specific document code
        """

        item = tests_assets.get_sample_item()
        self.assertEqual(item, self.inspector.getitem('q5cc4'))        
Ejemplo n.º 2
0
 def setUp(self):
     self.inspector = LogInspector(tests_assets.get_sample_allowed_patterns())