Exemplo n.º 1
0
    def test_doesnt_save_uncomplete_pickle_files(self):
        project = ProjectInDirectory(self.tmpdir)
        project.save()
        original_pickle = read_file_contents(project._get_pickle_path())

        # Inject unpickable object into project.
        project._injected_attr = UNPICKABLE_OBJECT
        try:
            project.save()
        except PicklingError:
            pass

        # Make sure that the original file wasn't overwritten.
        assert_equal_strings(original_pickle,
                             read_file_contents(project._get_pickle_path()))
Exemplo n.º 2
0
    def test_doesnt_save_uncomplete_pickle_files(self):
        project = ProjectInDirectory(self.tmpdir)
        project.save()
        original_pickle = read_file_contents(project._get_pickle_path())

        # Inject unpickable object into project.
        project._injected_attr = UNPICKABLE_OBJECT
        try:
            project.save()
        except PicklingError:
            pass

        # Make sure that the original file wasn't overwritten.
        assert_equal_strings(original_pickle,
                             read_file_contents(project._get_pickle_path()))