def test_print_config_value(self): mock_print = self.patch(snappy, 'print_msg') key = factory.make_name('key') value = factory.make_name('value') self.patch(snappy, 'get_config_value').return_value = value snappy.print_config_value(key) self.assertThat(mock_print, MockCalledOnceWith("%s=%s" % (key, value)))
def test_print_config_value_hidden(self): mock_print = self.patch(snappy, "print_msg") key = factory.make_name("key") value = factory.make_name("value") config = {key: value} snappy.print_config_value(config, key, hidden=True) mock_print.assert_called_once_with("{}=(hidden)".format(key))
def test_print_config_value_hidden(self): mock_print = self.patch(snappy, 'print_msg') key = factory.make_name('key') value = factory.make_name('value') config = {key: value} snappy.print_config_value(config, key, hidden=True) self.assertThat(mock_print, MockCalledOnceWith("{}=(hidden)".format(key)))
def test_print_config_value(self): mock_print = self.patch(snappy, "print_msg") key = factory.make_name("key") value = factory.make_name("value") config = {key: value} snappy.print_config_value(config, key) self.assertThat(mock_print, MockCalledOnceWith("{}={}".format(key, value)))