Пример #1
0
class TestOrder(unittest.TestCase):
    """

    Testing all methods of the Order abstraction

    """

    def setUp(self):
        self.order = Order('email')

    def test_order_init(self):
        o = Order('test')
        self.assertIsInstance(o, Order)

    def test_order_init_sets_typ(self):
        o = Order('test')
        self.assertEqual('test', o.typ)

    def test_order_asc(self):
        self.order.asc()
        self.assertEqual(True, self.order.ascending)

    def test_order_desc(self):
        self.order.desc()
        self.assertEqual(False, self.order.ascending)

    def test_order_to_dict(self):
        expected = dict(order='email_asc')
        self.order.ascending = True
        self.assertDictEqual(expected, self.order.to_dict())
Пример #2
0
class TestOrder(unittest.TestCase):
    """

    Testing all methods of the Order abstraction

    """
    def setUp(self):
        self.order = Order('email')

    def test_order_init(self):
        o = Order('test')
        self.assertIsInstance(o, Order)

    def test_order_init_sets_typ(self):
        o = Order('test')
        self.assertEqual('test', o.typ)

    def test_order_asc(self):
        self.order.asc()
        self.assertEqual(True, self.order.ascending)

    def test_order_desc(self):
        self.order.desc()
        self.assertEqual(False, self.order.ascending)

    def test_order_to_dict(self):
        expected = dict(order='email_asc')
        self.order.ascending = True
        self.assertDictEqual(expected, self.order.to_dict())
Пример #3
0
 def created_at(cls):
     """Creates and returns an created_at Order
     :return: Order object
     """
     return Order(typ='created_at')
Пример #4
0
 def amount(cls):
     """Creates and returns an amount Order
     :return: Order object
     """
     return Order(typ='amount')
Пример #5
0
 def client(cls):
     """Creates and returns an client Order
     :return: Order object
     """
     return Order(typ='client')
Пример #6
0
 def transaction(cls):
     """Creates and returns an transaction Order
     :return: Order object
     """
     return Order(typ='transaction')
Пример #7
0
 def test_order_init_sets_typ(self):
     o = Order('test')
     self.assertEqual('test', o.typ)
Пример #8
0
 def test_order_init(self):
     o = Order('test')
     self.assertIsInstance(o, Order)
Пример #9
0
 def setUp(self):
     self.order = Order('email')
Пример #10
0
 def trial_period_days(cls):
     """Creates and returns an trial_period_days Order
     :return: Order object
     """
     return Order(typ='trial_period_days')
Пример #11
0
 def interval(cls):
     """Creates and returns an interval Order
     :return: Order object
     """
     return Order(typ='interval')
Пример #12
0
 def email(cls):
     """Creates and returns an email Order
     :return: Order object
     """
     return Order(typ='email')
Пример #13
0
 def url(cls):
     """Creates and returns an url Order
     :return: Order object
     """
     return Order(typ='url')
Пример #14
0
 def setUp(self):
     self.order = Order('email')