Esempio n. 1
0
	def test_should_pickle(self):
		state = FileState(self.filename)
		state.info = TestResultSet()
		result = TestResult('error', 'test', 'errors', 01234)
		state.info.add(result)
		import pickle
		pickled = pickle.dumps(state)
		loaded_state = pickle.loads(pickled)
		self.assertEqual(repr(state), repr(loaded_state) + "___")
Esempio n. 2
0
 def test_should_pickle(self):
     state = FileState(self.filename)
     state.info = TestResultSet()
     result = TestResult('error', 'test', 'errors', 01234)
     state.info.add(result)
     import pickle
     pickled = pickle.dumps(state)
     loaded_state = pickle.loads(pickled)
     self.assertEqual(repr(state), repr(loaded_state) + "___")
Esempio n. 3
0
	def test_should_update_mtime(self):
		stamp = FileState(self.filename)
		self._touch()
		self.assertTrue(stamp.stale())
		stamp.update()
		self.assertFalse(stamp.stale())
Esempio n. 4
0
	def test_should_check_staleness(self):
		stamp = FileState(self.filename)
		self._touch()
		self.assertTrue(stamp.stale())
Esempio n. 5
0
 def test_should_default_to_new_test_result_set_info(self):
     self.assertEqual(FileState(self.filename).info, TestResultSet())
Esempio n. 6
0
 def test_should_update_mtime(self):
     stamp = FileState(self.filename)
     self._touch()
     self.assertTrue(stamp.stale())
     stamp.update()
     self.assertFalse(stamp.stale())
Esempio n. 7
0
 def test_should_check_staleness(self):
     stamp = FileState(self.filename)
     self._touch()
     self.assertTrue(stamp.stale())
Esempio n. 8
0
    def test_should_get_current_modtime(self):
        mtime = os.stat(self.filename).st_mtime
        stamp = FileState(self.filename)

        self.assertEqual(stamp.path, self.filename)
        self.assertEqual(stamp.modtime, mtime)