예제 #1
0
    def test_parse_corp_contact_list(self):
        api_result, _, _ = make_api_result("corp/contact_list.xml")

        result = contact_list.parse_contact_list(api_result)

        expected_result = {
            'corp': {
                1082138174: {'standing': 10.0, 'id': 1082138174,
                             'name': 'Nomad LLP',
                             'in_watchlist': None},
                1086308227: {'standing': 0.0, 'id': 1086308227,
                             'name': 'Rebel Alliance of New Eden',
                             'in_watchlist': None},
                1113838907: {'standing': -10.0, 'id': 1113838907,
                             'name': 'Significant other',
                             'in_watchlist': None}
            },
            'alliance': {
                2049763943: {'standing': -10.0, 'id': 2049763943,
                             'name': 'EntroPraetorian Aegis',
                             'in_watchlist': None},
                2067199408: {'standing': -10.0, 'id': 2067199408,
                             'name': 'Vera Cruz Alliance',
                             'in_watchlist': None},
                2081065875: {'standing': -10.0, 'id': 2081065875,
                             'name': 'TheRedMaple',
                             'in_watchlist': None}
            },
        }

        self.assertEqual(result['alliance'], expected_result['alliance'])
        self.assertEqual(result['corp'], expected_result['corp'])
        self.assertFalse('personal' in result)

        self.assertEqual(sorted(result.keys()), sorted(expected_result.keys()))
예제 #2
0
파일: corp.py 프로젝트: dinoboff/evelink
    def contacts(self, api_result=None):
        """Return the corp's corp and alliance contact lists."""

        if api_result is None:
            api_result = self.api.get('corp/ContactList')

        return api.APIResult(parse_contact_list(api_result.result), api_result.timestamp, api_result.expires)
예제 #3
0
    def test_parse_char_contact_list(self):
        api_result, _, _ = make_api_result("char/contact_list.xml")

        result = contact_list.parse_contact_list(api_result)

        expected_result = {
            'corp': {
                1082138174: {'standing': 10.0, 'id': 1082138174,
                             'name': 'Nomad LLP',
                             'in_watchlist': None},
                1086308227: {'standing': 0.0, 'id': 1086308227,
                             'name': 'Rebel Alliance of New Eden',
                             'in_watchlist': None},
                1113838907: {'standing': -10.0, 'id': 1113838907,
                             'name': 'Significant other',
                             'in_watchlist': None}
            },
            'alliance': {
                2049763943: {'standing': -10.0, 'id': 2049763943,
                             'name': 'EntroPraetorian Aegis',
                             'in_watchlist': None},
                2067199408: {'standing': -10.0, 'id': 2067199408,
                             'name': 'Vera Cruz Alliance',
                             'in_watchlist': None},
                2081065875: {'standing': -7.5, 'id': 2081065875,
                             'name': 'TheRedMaple',
                             'in_watchlist': None}
            },
            'personal': {
                3009988: {'standing': 0.0, 'id': 3009988,
                          'name': 'Navittus Sildbena',
                          'in_watchlist': True},
                544497016: {'standing': 10.0, 'id': 544497016,
                            'name': 'Valkyries of Night',
                            'in_watchlist': False}
            }
        }

        self.assertEqual(result['personal'], expected_result['personal'])
        self.assertEqual(result['alliance'], expected_result['alliance'])
        self.assertEqual(result['corp'], expected_result['corp'])
        self.assertEqual(sorted(result.keys()), sorted(expected_result.keys()))
예제 #4
0
 def contacts(self, api_result=None):
     """Return a character's personal, corp and alliance contact lists."""
     return api.APIResult(parse_contact_list(api_result.result), api_result.timestamp, api_result.expires)
예제 #5
0
 def contacts(self):
     """Return the corp's corp and alliance contact lists."""
     api_result = self.api.get('corp/ContactList')
     return parse_contact_list(api_result)
예제 #6
0
파일: char.py 프로젝트: EricE/evelink
    def contacts(self):
        """Return a character's personal, corp and alliance contact lists."""
        api_result = self.api.get('char/ContactList',
            {'characterID': self.char_id})

        return parse_contact_list(api_result)
예제 #7
0
파일: corp.py 프로젝트: ayust/evelink
 def contacts(self, api_result=None):
     """Return the corp's corp and alliance contact lists."""
     return api.APIResult(parse_contact_list(api_result.result), api_result.timestamp, api_result.expires)
예제 #8
0
 def contacts(self, api_result=None):
     """Return the corp's corp and alliance contact lists."""
     return api.APIResult(parse_contact_list(api_result.result),
                          api_result.timestamp, api_result.expires)
예제 #9
0
 def contacts(self, api_result=None):
     """Return a character's personal, corp and alliance contact lists."""
     return api.APIResult(parse_contact_list(api_result.result),
                          api_result.timestamp, api_result.expires)