Added verbose version of test_a
authorMike Jackson <michaelj@epcc.ed.ac.uk>
Tue, 2 Apr 2013 16:14:47 +0000 (09:14 -0700)
committerW. Trevor King <wking@tremily.us>
Fri, 1 Nov 2013 04:21:27 +0000 (21:21 -0700)
testing/Writing.md

index 3e4ffeb7d1c9a67c6177283216534aad09ea1ccc..f2ccdf6ab919696d4ba3ae3088cbd4fb04eed11b 100755 (executable)
@@ -103,6 +103,13 @@ Typically, a test function,
 * Runs the function or component being tested on the inputs to get some actual outputs.
 * Checks that the actual outputs match the expected outputs. We use assertions as part of this checking. We can check both that conditions hold and that conditions do not hold.
 
+So, we could rewrite `test_a`, as the more, verbose, but equivalent,
+
+    def test_a():
+        expected = NUCLEOTIDES['A']
+        actual = calculate_weight('A')                     
+        assert expected == actual
+
 Python `assert` allows us to check,
 
     assert should_be_true()