|
@@ -43,6 +43,15 @@ def get_article():
|
|
state = u'goood',
|
|
state = u'goood',
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+def get_transportation():
|
|
|
|
+ return dingguo.Transportation(
|
|
|
|
+ name = u'ticket',
|
|
|
|
+ price_brutto = get_sum_a(),
|
|
|
|
+ departure_point = u'home',
|
|
|
|
+ destination_point = u'city',
|
|
|
|
+ distance = dingguo.Distance(3.21, u'km'),
|
|
|
|
+ )
|
|
|
|
+
|
|
def get_discount_a():
|
|
def get_discount_a():
|
|
return dingguo.Discount(
|
|
return dingguo.Discount(
|
|
name = u'discount a',
|
|
name = u'discount a',
|
|
@@ -225,7 +234,7 @@ def test_distance_to_yaml():
|
|
def test_distance_from_yaml():
|
|
def test_distance_from_yaml():
|
|
assert dingguo.Distance(1.34, u'km') == yaml.load(u"!distance '1.34 km'\n")
|
|
assert dingguo.Distance(1.34, u'km') == yaml.load(u"!distance '1.34 km'\n")
|
|
|
|
|
|
-def test_article_to_yaml_a():
|
|
|
|
|
|
+def test_article_to_yaml():
|
|
assert to_yaml(get_article()) == u"""!article
|
|
assert to_yaml(get_article()) == u"""!article
|
|
authors:
|
|
authors:
|
|
- a
|
|
- a
|
|
@@ -239,7 +248,7 @@ shipper: shipper
|
|
state: goood
|
|
state: goood
|
|
"""
|
|
"""
|
|
|
|
|
|
-def test_article_to_yaml_a():
|
|
|
|
|
|
+def test_article_to_yaml():
|
|
assert get_article() == yaml.load(u"""!article
|
|
assert get_article() == yaml.load(u"""!article
|
|
authors:
|
|
authors:
|
|
- a
|
|
- a
|
|
@@ -252,3 +261,23 @@ reseller: seller
|
|
shipper: shipper
|
|
shipper: shipper
|
|
state: goood
|
|
state: goood
|
|
""")
|
|
""")
|
|
|
|
+
|
|
|
|
+def test_transportation_to_yaml():
|
|
|
|
+ assert to_yaml(get_transportation()) == u"""!transportation
|
|
|
|
+departure_point: home
|
|
|
|
+destination_point: city
|
|
|
|
+distance: !distance '3.21 km'
|
|
|
|
+name: ticket
|
|
|
|
+price_brutto: !sum '1.23 EUR'
|
|
|
|
+route_map: null
|
|
|
|
+"""
|
|
|
|
+
|
|
|
|
+def test_transportation_from_yaml():
|
|
|
|
+ assert get_transportation() == yaml.load(u"""!transportation
|
|
|
|
+departure_point: home
|
|
|
|
+destination_point: city
|
|
|
|
+distance: !distance '3.21 km'
|
|
|
|
+name: ticket
|
|
|
|
+price_brutto: !sum '1.23 EUR'
|
|
|
|
+route_map: null
|
|
|
|
+""")
|