コード例 #1
0
ファイル: test_projects.py プロジェクト: Felix11H/sumatra
 def delete_record__should_update_most_recent(self):
     """see ticket:36."""
     proj = Project("test_project",
                    record_store=MockRecordStore())
     proj.add_record(MockRecord("record1"))
     self.assertEqual(proj._most_recent, "record1")
     proj.add_record(MockRecord("record2"))
     self.assertEqual(proj._most_recent, "record2")
     proj.delete_record("record2")
     self.assertEqual(proj._most_recent, "last")  # should really be "record1", but we are not testing RecordStore here
コード例 #2
0
ファイル: test_projects.py プロジェクト: pv/sumatra
 def delete_record__should_update_most_recent(self):
     """see ticket:36."""
     proj = Project("test_project",
                    record_store=MockRecordStore())
     proj.add_record(MockRecord("record1"))
     self.assertEqual(proj._most_recent, "record1")
     proj.add_record(MockRecord("record2"))
     self.assertEqual(proj._most_recent, "record2")
     proj.delete_record("record2")
     self.assertEqual(proj._most_recent, "last")  # should really be "record1", but we are not testing RecordStore here
コード例 #3
0
ファイル: test_projects.py プロジェクト: Felix11H/sumatra
 def test__delete_record__calls_delete_on_the_record_store(self):
     proj = Project("test_project",
                    record_store=MockRecordStore())
     proj.delete_record("foo")
     self.assertEqual(proj.record_store.deleted, "foo")
コード例 #4
0
 def test__delete_record__calls_delete_on_the_record_store(self):
     proj = Project("test_project", record_store=MockRecordStore())
     proj.delete_record("foo")
     self.assertEqual(proj.record_store.deleted, "foo")