Esempio n. 1
0
    def testSortSubDirectories(self):
        expected_list = ['20120912072912', '20120912073312', '20120913072230']
        monitor = FileMonitor(self.device_name)
        monitor.setInboxPath(self.temp_dir)
        # call property setter for testing
        actual_list = monitor.sortSubDirectories()
#        print actual_list
        result = cmp(expected_list, actual_list)
        # print "result:" + str(result)
        self.assertEquals(0, result, 'number not equals')
Esempio n. 2
0
    def testParseZippedFiles(self):
        '''def parseZippedFiles(self,directory): 47 + 21 = 68'''
        
        test_dir = self.temp_dir + '/20120913072230/'
#        print test_dir
        monitor = FileMonitor(self.device_name)
        monitor.setInboxPath(self.temp_dir)
#        print monitor.__dict__
        monitor.parseZippedFiles(test_dir)
        num_events = self.db.count('events')
        self.db.removeAll('events')
        self.assertEquals(85, num_events, 'events collection should have 85 documents')