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()))
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()))
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()))