示例#1
0
    def test_stdin(self, parse_args, stdin_patch):
        emails = ['*****@*****.**']
        stdin_patch.return_value = emails
        options = self.test_options
        options.stdin = True
        parse_args.return_value = options

        program = Main(test=True)
        program.run()

        eq_(program.get_matches(), emails)
        eq_(stdin_patch.call_count, 1)
示例#2
0
    def test_url(self, parse_args, file_patch):
        emails = ['*****@*****.**']
        file_patch.return_value = emails
        options = self.test_options
        options.path = 'test_path'
        parse_args.return_value = options

        program = Main(test=True)
        program.run()

        eq_(program.get_matches(), emails)
        eq_(file_patch.call_count, 1)
        eq_(file_patch.call_args, call('test_path'))