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()))
Beispiel #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()))
 def test_matcher(self):
     tempdir = self.mkdtemp()
     filename = os.path.join(tempdir, 'foo')
     self.create_file(filename, 'Hello World!')
     self.assertThat(filename,
                     FileContains(matcher=DocTestMatches('Hello World!')))
 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()))
Beispiel #5
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()))