import unittest
from notbank_python_sdk.notbank_client import NotbankClient

from notbank_python_sdk.requests_models.get_products_request import GetProductsRequest
from tests import test_helper


class TestGetProducts(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        connection = test_helper.new_rest_client_connection()
        cls.credentials = test_helper.load_credentials()
        test_helper.authenticate_connection(connection, cls.credentials)
        cls.client = NotbankClient(connection)

    def test_get_products(self):
        response = self.client.get_products()
        print(response)

    def test_get_products_including_disabled(self):
        response = self.client.get_products(
            GetProductsRequest(get_disabled=True))
        print(response)

    def test_get_filtered_products(self):
        response = self.client.get_products(GetProductsRequest(
            attribute="Pegged",
            attribute_value=True))
        print(response)

    def test_get_products_2(self):
        response = self.client.get_products(GetProductsRequest(
            get_disabled=False,
            depth=10,
            start_index=0))
        print(response)


if __name__ == "__main__":
    unittest.main()
