예제 #1
0
 def test_does_not_contain(self):
     tempdir = self.mkdtemp()
     filename = os.path.join(tempdir, 'foo')
     self.create_file(filename, 'Goodbye Cruel World!')
     mismatch = FileContains('Hello World!').match(filename)
     self.assertThat(
         Equals('Hello World!').match('Goodbye Cruel World!').describe(),
         Equals(mismatch.describe()))
예제 #2
0
 def test_does_not_contain(self):
     tempdir = self.mkdtemp()
     filename = os.path.join(tempdir, 'foo')
     self.create_file(filename, 'Goodbye Cruel World!')
     mismatch = FileContains('Hello World!').match(filename)
     self.assertThat(
         Equals('Hello World!').match('Goodbye Cruel World!').describe(),
         Equals(mismatch.describe()))
예제 #3
0
 def test_not_exists(self):
     doesntexist = os.path.join(self.mkdtemp(), 'doesntexist')
     mismatch = FileContains('').match(doesntexist)
     self.assertThat(PathExists().match(doesntexist).describe(),
                     Equals(mismatch.describe()))
예제 #4
0
 def test_not_exists(self):
     doesntexist = os.path.join(self.mkdtemp(), 'doesntexist')
     mismatch = FileContains('').match(doesntexist)
     self.assertThat(
         PathExists().match(doesntexist).describe(),
         Equals(mismatch.describe()))