コード例 #1
0
    def test_Tables_KnownAccessFile(self):
        import pymdb
        result = pymdb.parsefile(accessfile)

        self.assertTrue(
            result == {
                'Table2': {
                    'headers': ['ID', 'Field1'],
                    'data': [['1', 'Thing 1'], ['2', 'Thing 2'],
                             ['3', 'Thing 3']]
                },
                'Table3': {
                    'headers': ['ID', 'Field1'],
                    'data': [['1', 'Thing 1'], ['2', 'Thing 2'],
                             ['3', 'Thing 3']]
                },
                'Table1': {
                    'headers': ['ID', 'Field1'],
                    'data': [['1', 'Thing 1'], ['2', 'Thing 2'],
                             ['3', 'Thing 3']]
                }
            })
        self.assertTrue("Table1" in result.keys())
        self.assertTrue("Table2" in result.keys())
        self.assertTrue("Table3" in result.keys())

        for entry in result.keys():
            headercount = len(result[entry]["headers"])
            self.assertTrue(len(result[entry]['data']) >= 3)
            for element in result[entry]['data']:
                self.assertTrue(len(element) >= 2)
                self.assertTrue(len(element) == headercount)
コード例 #2
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_Tables_KnownAccessFile(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     
     self.assertTrue(
         result == {
             'Table2': {'headers': ['ID','Field1'], 'data': [['1', 'Thing 1'], ['2', 'Thing 2'], ['3', 'Thing 3']]}, 
             'Table3': {'headers': ['ID','Field1'], 'data': [['1', 'Thing 1'], ['2', 'Thing 2'], ['3', 'Thing 3']]}, 
             'Table1': {'headers': ['ID','Field1'], 'data': [['1', 'Thing 1'], ['2', 'Thing 2'], ['3', 'Thing 3']]}
         }
     )
     self.assertTrue( "Table1" in result.keys())
     self.assertTrue( "Table2" in result.keys())
     self.assertTrue( "Table3" in result.keys())
     
     for entry in result.keys():
         headercount = len(result[entry]["headers"])
         self.assertTrue( len(result[entry]['data'] ) >= 3 )
         for element in result[entry]['data']:
             self.assertTrue( len(element) >= 2 )
             self.assertTrue( len(element) == headercount )
コード例 #3
0
    def test_parsefile_Returns_Dictionary_Contains_Dictionaries(self):
        import pymdb
        result = pymdb.parsefile(accessfile)

        for entry in result.keys():
            self.assertIsInstance(result[entry], dict)
コード例 #4
0
    def test_parsefile_Returns_Dictionary_Keys(self):
        import pymdb
        result = pymdb.parsefile(accessfile)

        for entry in result.keys():
            self.assertIsInstance(entry, str)
コード例 #5
0
 def test_parsefile_Returns_Dictionary(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     self.assertIsInstance(result, dict)
コード例 #6
0
 def test_parsefile_Returns_Tables(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     self.assertGreater(len(result.keys()), 0)
コード例 #7
0
 def test_parsefile_Runs(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     self.assertIsNotNone(result)
コード例 #8
0
 def test_parsefileNone_Runs(self):
     import pymdb
     result = pymdb.parsefile("")
     self.assertIsNone(result)
コード例 #9
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_parsefile_Returns_Dictionary_Contains_Dictionaries(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     
     for entry in result.keys():
         self.assertIsInstance(result[entry], dict)
コード例 #10
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_parsefile_Returns_Dictionary_Keys(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     
     for entry in result.keys():
         self.assertIsInstance(entry, str)
コード例 #11
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_parsefile_Returns_Dictionary(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     self.assertIsInstance(result, dict)
コード例 #12
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_parsefile_Returns_Tables(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     self.assertGreater(len(result.keys()), 0)
コード例 #13
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_parsefile_Runs(self):
     import pymdb
     result = pymdb.parsefile(accessfile)
     self.assertIsNotNone(result)
コード例 #14
0
ファイル: Test_pymdb.py プロジェクト: dannyarcher/pymdb
 def test_parsefileNone_Runs(self):
     import pymdb
     result = pymdb.parsefile("")
     self.assertIsNone(result)