예제 #1
0
    def refresh_credentials(self):
        logging.warning("Unauthorized. Client: %s", self.client)

        print("Time to refresh credentials!")
        print("Log in to trello at https://trello.com,\
            then visit https://trello.com/app-key")

        self.api_key = input("Trello API key: ")
        CONFIG.write_config(["TRELLO", "api_key"], self.api_key)

        self.token = input("Trello token: ")
        CONFIG.write_config(["TRELLO", "token"], self.token)

        self.login_petition()
예제 #2
0
 def list_to_yaml(self, board_name, list_name, list_id):
     CONFIG.write_config(
         ['TRELLO', 'boards', board_name, list_name, 'id'], list_id)
예제 #3
0
 def test_write_config_saved_to_disc(self):
     CONFIG.write_config(["CALENDAR", "user"], "flamingo")
     CONFIG.load_config(self.conf_file)
     value = CONFIG.get_config(["CALENDAR", "user"])
     self.assertEqual(value, "flamingo")
예제 #4
0
 def board_to_yaml(self, name, board_id):
     CONFIG.write_config(['TRELLO', 'boards', name, 'id'], board_id)
예제 #5
0
 def test_write_config_running_multi_inexistant_field(self):
     CONFIG.write_config(["CALENDAR", "box", "colour", "id"], "5")
     value = CONFIG.get_config(["CALENDAR", "box", "colour", "id"])
     self.assertEqual(value, "5")
예제 #6
0
 def test_write_config_running_single_inexistant_field(self):
     CONFIG.write_config(["CALENDAR", "colour"], "pink")
     value = CONFIG.get_config(["CALENDAR", "colour"])
     self.assertEqual(value, "pink")
예제 #7
0
 def test_write_config_running(self):
     CONFIG.write_config(["CALENDAR", "user"], "flamingo")
     value = CONFIG.get_config(["CALENDAR", "user"])
     self.assertEqual(value, "flamingo")
예제 #8
0
 def test_login__wrong_credentials(self, mock):
     CONFIG.write_config(['TRELLO', 'token'], "1")
     self.t_client.login()
     self.assertTrue(mock.called)
예제 #9
0
 def test_login__no_token(self, mock):
     CONFIG.write_config(['TRELLO', 'token'], None)
     self.t_client.login()
     self.assertTrue(mock.called)