'corp_id': 123456789,
                    'faction_id': None,
                    'id': 30000480,
                    'name': '0-G8NO',
                },
                30001597: {
                    'alliance_id': 1028876240,
                    'corp_id': 421957727,
                    'faction_id': None,
                    'id': 30001597,
                    'name': 'M-NP5O',
                },
                30023410: {
                    'alliance_id': None,
                    'corp_id': None,
                    'faction_id': 500002,
                    'id': 30023410,
                    'name': 'Embod',
                },
            })
        self.assertEqual(data_time, 1261545398)
        self.assertEqual(self.api.mock_calls, [
                mock.call.get('map/Sovereignty', params={}),
            ])
        self.assertEqual(current, 12345)
        self.assertEqual(expires, 67890)


if __name__ == "__main__":
    unittest.main()
Esempio n. 2
0
    @unittest.skipUnless(simple and isolator, "skipping simple test")
    def test_get_matching_product_for_id(self):
        asins = ['B001UDRNHO', '144930544X']
        response = self.mws.get_matching_product_for_id(
            MarketplaceId=self.marketplace_id, IdType='ASIN', IdList=asins)
        self.assertEqual(len(response._result), 2)
        for result in response._result:
            self.assertEqual(len(result.Products.Product), 1)

    @unittest.skipUnless(simple and isolator, "skipping simple test")
    def test_get_lowest_offer_listings_for_asin(self):
        asin = '144930544X'
        response = self.mws.get_lowest_offer_listings_for_asin(
            MarketplaceId=self.marketplace_id,
            ItemCondition='New',
            ASINList=[asin])
        listings = response._result[0].Product.LowestOfferListings
        self.assertTrue(len(listings.LowestOfferListing))

    @unittest.skipUnless(simple and isolator, "skipping simple test")
    def test_list_inventory_supply(self):
        asof = (datetime.today() - timedelta(days=30)).isoformat()
        response = self.mws.list_inventory_supply(QueryStartDateTime=asof,
                                                  ResponseGroup='Basic')
        self.assertTrue(hasattr(response._result, 'InventorySupplyList'))


if __name__ == "__main__":
    unittest.main()
Esempio n. 3
0
@attr(route53=True)
class TestRoute53PrivateZone(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        time_str = str(int(time.time()))
        self.route53 = Route53Connection()
        self.base_domain = 'boto-private-zone-test-%s.com' % time_str
        self.vpc = VPCConnection()
        self.test_vpc = self.vpc.create_vpc(cidr_block='10.11.0.0/16')
        # tag the vpc to make it easily identifiable if things go spang
        self.test_vpc.add_tag("Name", self.base_domain)
        self.zone = self.route53.get_zone(self.base_domain)
        if self.zone is not None:
            self.zone.delete()

    def test_create_private_zone(self):
        self.zone = self.route53.create_hosted_zone(self.base_domain,
                                                    private_zone=True,
                                                    vpc_id=self.test_vpc.id,
                                                    vpc_region='us-east-1')

    @classmethod
    def tearDownClass(self):
        if self.zone is not None:
            self.zone.delete()
        self.test_vpc.delete()

if __name__ == '__main__':
    unittest.main(verbosity=3)