def test_valid_response(self, raw_input_mock):
        raw_input_mock.return_value = 'n'
        result = formatting.valid_response('test', 'n')
        raw_input_mock.assert_called_with('test')
        self.assertTrue(result)

        raw_input_mock.return_value = 'N'
        result = formatting.valid_response('test', 'n')
        raw_input_mock.assert_called_with('test')
        self.assertTrue(result)
Example #2
0
    def test_valid_response(self, prompt_mock):
        prompt_mock.return_value = 'n'
        result = formatting.valid_response('test', 'n')
        prompt_mock.assert_called_with('test')
        self.assertTrue(result)

        prompt_mock.return_value = 'N'
        result = formatting.valid_response('test', 'n')
        prompt_mock.assert_called_with('test')
        self.assertTrue(result)
    def test_valid_response(self, raw_input_mock):
        raw_input_mock.return_value = "n"
        result = formatting.valid_response("test", "n")
        raw_input_mock.assert_called_with("test")
        self.assertTrue(result)

        raw_input_mock.return_value = "N"
        result = formatting.valid_response("test", "n")
        raw_input_mock.assert_called_with("test")
        self.assertTrue(result)
    def test_invalid_response(self, raw_input_mock):
        raw_input_mock.return_value = 'y'
        result = formatting.valid_response('test', 'n')
        raw_input_mock.assert_called_with('test')
        self.assertFalse(result)

        raw_input_mock.return_value = 'wakakwakwaka'
        result = formatting.valid_response('test', 'n')
        raw_input_mock.assert_called_with('test')
        self.assertFalse(result)

        raw_input_mock.return_value = ''
        result = formatting.valid_response('test', 'n')
        raw_input_mock.assert_called_with('test')
        self.assertEqual(result, None)
Example #5
0
    def test_invalid_response(self, prompt_mock):
        prompt_mock.return_value = 'y'
        result = formatting.valid_response('test', 'n')
        prompt_mock.assert_called_with('test')
        self.assertFalse(result)

        prompt_mock.return_value = 'wakakwakwaka'
        result = formatting.valid_response('test', 'n')
        prompt_mock.assert_called_with('test')
        self.assertFalse(result)

        prompt_mock.return_value = ''
        result = formatting.valid_response('test', 'n')
        prompt_mock.assert_called_with('test')
        self.assertEqual(result, None)
    def test_invalid_response(self, raw_input_mock):
        raw_input_mock.return_value = "y"
        result = formatting.valid_response("test", "n")
        raw_input_mock.assert_called_with("test")
        self.assertFalse(result)

        raw_input_mock.return_value = "wakakwakwaka"
        result = formatting.valid_response("test", "n")
        raw_input_mock.assert_called_with("test")
        self.assertFalse(result)

        raw_input_mock.return_value = ""
        result = formatting.valid_response("test", "n")
        raw_input_mock.assert_called_with("test")
        self.assertEqual(result, None)