<commit_before>"""
Tests for the MWS.Inventory API class.
"""
import unittest
import datetime
import mws
from .utils import CommonRequestTestTools


class InventoryTestCase(unittest.TestCase, CommonRequestTestTools):
    """
    Test cases for Inventory.
    """
    def setUp(self):
        self.api = mws.Inventory(
            self.CREDENTIAL_ACCESS,
            self.CREDENTIAL_SECRET,
            self.CREDENTIAL_ACCOUNT,
            auth_token=self.CREDENTIAL_TOKEN
        )
        self.api._test_request_params = True

    def test_list_inventory_supply(self):
        """
        ListInventorySupply operation
        """
        now = datetime.datetime.utcnow()
        now_timestamp = now.isoformat()
        skus = ['thing1', 'thing2']
        response_group = 'Detailed'
        params = self.api.list_inventory_supply(skus, now, response_group=response_group)
        self.assert_common_params(params)
        assert params['Action'] == 'ListInventorySupply'
        assert params['QueryStartDateTime'] == now_timestamp
        assert params['ResponseGroup'] == 'Detailed'
        assert params['SellerSkus.member.1'] == 'thing1'
        assert params['SellerSkus.member.2'] == 'thing2'

    def test_list_inventory_supply_by_next_token(self):
        """
        ListInventorySupplyByNextToken operation
        """
        next_token = 'token_foobar'
        params = self.api.list_inventory_supply(next_token=next_token)
        self.assert_common_params(params)
        assert params['Action'] == 'ListInventorySupplyByNextToken'
        assert params['NextToken'] == next_token

    def test_list_inventory_supply_by_next_token_alias(self):
        """
        ListInventorySupplyByNextToken operation by way of the alias method
        list_inventory_supply_by_next_token
        """
        next_token = 'token_foobar'
        params = self.api.list_inventory_supply_by_next_token(next_token)
        self.assert_common_params(params)
        assert params['Action'] == 'ListInventorySupplyByNextToken'
        assert params['NextToken'] == next_token
<commit_msg>Replace assert with self.assertEqual<commit_after>"""
Tests for the MWS.Inventory API class.
"""
import unittest
import datetime
import mws
from .utils import CommonRequestTestTools


class InventoryTestCase(unittest.TestCase, CommonRequestTestTools):
    """
    Test cases for Inventory.
    """
    def setUp(self):
        self.api = mws.Inventory(
            self.CREDENTIAL_ACCESS,
            self.CREDENTIAL_SECRET,
            self.CREDENTIAL_ACCOUNT,
            auth_token=self.CREDENTIAL_TOKEN
        )
        self.api._test_request_params = True

    def test_list_inventory_supply(self):
        """
        ListInventorySupply operation
        """
        now = datetime.datetime.utcnow()
        now_timestamp = now.isoformat()
        skus = ['thing1', 'thing2']
        response_group = 'Detailed'
        params = self.api.list_inventory_supply(skus, now, response_group=response_group)
        self.assert_common_params(params)
        self.assertEqual(params['Action'], 'ListInventorySupply')
        self.assertEqual(params['QueryStartDateTime'], now_timestamp)
        self.assertEqual(params['ResponseGroup'], 'Detailed')
        self.assertEqual(params['SellerSkus.member.1'], 'thing1')
        self.assertEqual(params['SellerSkus.member.2'], 'thing2')

    def test_list_inventory_supply_by_next_token(self):
        """
        ListInventorySupplyByNextToken operation
        """
        next_token = 'token_<PASSWORD>'
        params = self.api.list_inventory_supply(next_token=next_token)
        self.assert_common_params(params)
        self.assertEqual(params['Action'], 'ListInventorySupplyByNextToken')
        self.assertEqual(params['NextToken'], next_token)

    def test_list_inventory_supply_by_next_token_alias(self):
        """
        ListInventorySupplyByNextToken operation by way of the alias method
        list_inventory_supply_by_next_token
        """
        next_token = 'token_<PASSWORD>'
        params = self.api.list_inventory_supply_by_next_token(next_token)
        self.assert_common_params(params)
        self.assertEqual(params['Action'], 'ListInventorySupplyByNextToken')
        self.assertEqual(params['NextToken'], next_token)

{'fraction_non_alphanumeric': 0.09593837535014006, 'fraction_numerical': 0.0028011204481792717, 'mean_word_length': 3.1682879377431905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6632808', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1244, 'n_words': 202}