From af6662377ce4048c2214787ee2a1104a9f33839d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 18 Jun 2013 23:34:42 +0100 Subject: Basic bindings for jq --- tests/jq_tests.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/jq_tests.py (limited to 'tests') diff --git a/tests/jq_tests.py b/tests/jq_tests.py new file mode 100644 index 0000000..0bef31f --- /dev/null +++ b/tests/jq_tests.py @@ -0,0 +1,27 @@ +from nose.tools import istest, assert_equal + +import jq + + +@istest +def dot_operator_does_nothing(): + assert_equal( + "42", + jq.string_to_string(".", "42") + ) + + +@istest +def can_add_one_to_each_element_of_an_array(): + assert_equal( + "[2,3,4]", + jq.string_to_string("[.[]+1]", "[1,2,3]") + ) + + +@istest +def output_elements_are_separated_by_newlines(): + assert_equal( + "1\n2\n3", + jq.string_to_string(".[]", "[1,2,3]") + ) -- cgit v1.2.3