예제 #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
파일: offer.py 프로젝트: cruncher/pymill
 def trial_period_days(cls):
     """Creates and returns an trial_period_days Order
     :return: Order object
     """
     return Order(typ='trial_period_days')
예제 #11
0
파일: offer.py 프로젝트: cruncher/pymill
 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')