def test_extra_file(self):
     """diff_directories: target directory contains extra file
     
     """
     # Add extra file to a directory
     self.dir2.add_file("extra.txt","This is an extra test file")
     self.assertEqual(diff_directories(self.dir1.dirn,self.dir2.dirn),0)
     self.assertNotEqual(diff_directories(self.dir2.dirn,self.dir1.dirn),0)
    def test_broken_links(self):
        """diff_directories: handle broken links

        """
        # Add broken link
        self.dir1.add_link("broken","missing.txt")
        self.assertNotEqual(diff_directories(self.dir1.dirn,
                                             self.dir2.dirn),0)
        self.assertEqual(diff_directories(self.dir2.dirn,
                                          self.dir1.dirn),0)
    def test_different_file(self):
        """diff_directories: file differs between directories

        """
        # Add different versions of a file to each directory
        self.dir1.add_file("diff.txt","This is one version of the file")
        self.dir2.add_file("diff.txt","This is another version of the file")
        self.assertNotEqual(diff_directories(self.dir1.dirn,
                                             self.dir2.dirn),0)
        self.assertNotEqual(diff_directories(self.dir2.dirn,
                                             self.dir1.dirn),0)
    def test_same_dirs(self):
        """diff_directories: identical directories are identified as identical

        """
        self.assertEqual(diff_directories(self.empty_dir1,self.empty_dir2),0)
        self.assertEqual(diff_directories(self.dir1.dirn,self.dir2.dirn),0)