Exemple #1
0
 def test_read_data(self):
     r = self.create_trello()
     from th_trello.my_trello import ServiceTrello
     kwargs = {'trigger_id': r.trigger_id}
     t = ServiceTrello()
     t.read_data(**kwargs)
     data = list()
     self.assertTrue(type(data) is list)
     self.assertTrue('trigger_id' in kwargs)
Exemple #2
0
 def test_read_data(self):
     r = self.create_trello()
     from th_trello.my_trello import ServiceTrello
     kwargs = {'trigger_id': r.trigger_id}
     t = ServiceTrello()
     t.read_data(**kwargs)
     data = list()
     self.assertTrue(type(data) is list)
     self.assertTrue('trigger_id' in kwargs)
Exemple #3
0
    def test_save_data_no_title(self):
        """
           Test if the creation of the Trello object looks fine (no title)
        """
        self.create_trello()
        data = {'link': '', 'title': '', 'content': ''}

        se = ServiceTrello(self.token)
        result = se.save_data(self.trigger_id, **data)
        self.assertFalse(result)
Exemple #4
0
    def test_read_data(self):
        """
           Test if the reading of the Trello object looks fine
        """
        self.create_trello()
        data = {'link': 'http://foo.bar/some/thing/else/what/else',
                'title': 'what else',
                'content': 'foobar'}

        se = ServiceTrello(self.token)
        data = se.read_data(**data)
        self.assertIsInstance(data, list)
Exemple #5
0
    def test_save_data_no_title(self):
        """
           Test if the creation of the Trello object looks fine (no title)
        """
        self.create_trello()
        data = {'link': '',
                'title': '',
                'content': ''}

        se = ServiceTrello(self.token)
        result = se.save_data(self.trigger_id, **data)
        self.assertFalse(result)
Exemple #6
0
 def test_read_data(self):
     """
        Test if the reading of the Trello object looks fine
     """
     r = self.create_trello()
     data = {'model_name': 'Trello',
             'app_label': 'th_trello',
             'trigger_id': r.trigger_id,
             'link': 'http://foo.bar/some/thing/else/what/else',
             'title': 'what else',
             'content': 'foobar'}
     se = ServiceTrello(self.token)
     data = se.read_data(**data)
     self.assertIsInstance(data, list)
Exemple #7
0
    def test_save_data(self):
        """
           Test if the creation of the Trello object looks fine
        """
        t = self.create_trello()
        data = {'link': 'http://foo.bar/some/thing/else/what/else',
                'title': 'what else',
                'content': 'foobar'}

        with patch.object(TrelloClient, 'add_board') as mock_save_data2:
            with patch.object(TrelloClient, 'list_boards') as mock_save_data:
                se = ServiceTrello(self.token)
                se.save_data(self.trigger_id, **data)
            mock_save_data.assert_called_once_with()
        mock_save_data2.assert_called_once_with(t.board_name)
Exemple #8
0
 def test_read_data(self):
     """
        Test if the reading of the Trello object looks fine
     """
     r = self.create_trello()
     data = {
         'model_name': 'Trello',
         'app_label': 'th_trello',
         'trigger_id': r.trigger_id,
         'link': 'http://foo.bar/some/thing/else/what/else',
         'title': 'what else',
         'content': 'foobar'
     }
     se = ServiceTrello(self.token)
     data = se.read_data(**data)
     self.assertIsInstance(data, list)