示例#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_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!')))
示例#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()))
示例#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()))