Example #1
0
 def test_not_a_directory(self):
     filename = os.path.join(self.mkdtemp(), 'foo')
     self.touch(filename)
     mismatch = DirExists().match(filename)
     self.assertThat("%s is not a directory." % filename,
                     Equals(mismatch.describe()))
Example #2
0
 def test_not_exists(self):
     doesntexist = os.path.join(self.mkdtemp(), 'doesntexist')
     mismatch = DirExists().match(doesntexist)
     self.assertThat(PathExists().match(doesntexist).describe(),
                     Equals(mismatch.describe()))
Example #3
0
 def test_not_a_directory(self):
     filename = os.path.join(self.mkdtemp(), 'foo')
     self.touch(filename)
     mismatch = DirExists().match(filename)
     self.assertThat(
         "%s is not a directory." % filename, Equals(mismatch.describe()))
Example #4
0
 def test_exists(self):
     tempdir = self.mkdtemp()
     self.assertThat(tempdir, DirExists())
Example #5
0
 def test_not_exists(self):
     doesntexist = os.path.join(self.mkdtemp(), 'doesntexist')
     mismatch = DirExists().match(doesntexist)
     self.assertThat(
         PathExists().match(doesntexist).describe(),
         Equals(mismatch.describe()))