'Running it on a branch with a fragment in the topfiles dir added
returns green, even if there are other files in the topfiles dir.'

def test_newsfragmentAddedButWithOtherNewsfragments(self):

    runCommand(['git', 'checkout', '-b', 'quotefile'], cwd=self.repo.path)
    newsfragments = self.repo.child('twisted').child('newsfragments')
    newsfragments.makedirs()
    fragment = newsfragments.child('1234.misc')
    fragment.setContent('')
    unrelated = newsfragments.child('somefile')
    unrelated.setContent('Boo')
    runCommand(['git', 'add', fragment.path, unrelated.path], cwd=self.repo.path)
    runCommand(['git', 'commit', '-m', 'newsfragment'], cwd=self.repo.path)
    logs = []
    with self.assertRaises(SystemExit) as e:
        CheckNewsfragmentScript(logs.append).main([self.repo.path])
    self.assertEqual(e.exception.args, (0,))
    self.assertEqual(logs[(-1)], 'Found    twisted/newsfragments/1234.misc')
