summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Herlant <aerostitch@users.noreply.github.com>2019-11-24 11:43:12 -0800
committerClaude Paroz <claude@2xlibre.net>2019-11-24 20:43:12 +0100
commit5ff4a55ae6fb8a6f9d9d5d8ffeb2c5b8ffa51c85 (patch)
treedcb6eae76b498b7a9d52787c5704d446027d8562 /tests
parentce7d887adc753de33812fe5eb88a1f30be396a6e (diff)
downloadtablib-5ff4a55ae6fb8a6f9d9d5d8ffeb2c5b8ffa51c85.tar.gz
Force default_flow_style for pyyaml safe_dump
This is to keep behavior of pre-5.1 pyyaml.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_tablib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_tablib.py b/tests/test_tablib.py
index 87482e0..5754bb2 100755
--- a/tests/test_tablib.py
+++ b/tests/test_tablib.py
@@ -1092,6 +1092,17 @@ class YAMLTests(BaseTestCase):
self.assertEqual(_yaml, data.yaml)
+ def test_yaml_export(self):
+ """YAML export"""
+
+ expected = """\
+- {first_name: John, gpa: 90, last_name: Adams}
+- {first_name: George, gpa: 67, last_name: Washington}
+- {first_name: Thomas, gpa: 50, last_name: Jefferson}
+"""
+ output = self.founders.yaml
+ self.assertEqual(output, expected)
+
class LatexTests(BaseTestCase):
def test_latex_export(self):