Esempio n. 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()))
Esempio n. 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()))
Esempio n. 3
0
 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!')))
Esempio n. 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()))
Esempio n. 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()))