trackler 2.2.1.48 → 2.2.1.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/grains/canonical-data.json +1 -1
  4. data/problem-specifications/exercises/isbn-verifier/description.md +1 -1
  5. data/tracks/dart/exercises/anagram/pubspec.lock +10 -10
  6. data/tracks/dart/exercises/bob/pubspec.lock +4 -4
  7. data/tracks/dart/exercises/difference-of-squares/pubspec.lock +4 -4
  8. data/tracks/dart/exercises/gigasecond/pubspec.lock +4 -4
  9. data/tracks/dart/exercises/hamming/pubspec.lock +4 -4
  10. data/tracks/dart/exercises/hello-world/pubspec.lock +4 -4
  11. data/tracks/dart/exercises/leap/pubspec.lock +4 -4
  12. data/tracks/dart/exercises/phone-number/pubspec.lock +4 -4
  13. data/tracks/dart/exercises/raindrops/pubspec.lock +17 -5
  14. data/tracks/dart/exercises/rna-transcription/pubspec.lock +4 -4
  15. data/tracks/dart/exercises/word-count/pubspec.lock +4 -4
  16. data/tracks/dart/pubspec.lock +3 -3
  17. data/tracks/fsharp/exercises/largest-series-product/Example.fs +18 -4
  18. data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProduct.fs +1 -1
  19. data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs +80 -36
  20. data/tracks/fsharp/generators/Exercise.fs +1 -1
  21. data/tracks/fsharp/generators/Generators.fs +10 -0
  22. data/tracks/gnu-apl/config.json +14 -0
  23. data/tracks/gnu-apl/exercises/difference-of-squares/README.md +19 -0
  24. data/tracks/gnu-apl/exercises/difference-of-squares/difference-of-squares-example.apl +13 -0
  25. data/tracks/gnu-apl/exercises/difference-of-squares/difference-of-squares.tc +38 -0
  26. data/tracks/gnu-apl/exercises/pangram/README.md +15 -0
  27. data/tracks/gnu-apl/exercises/pangram/pangram-example.apl +14 -0
  28. data/tracks/gnu-apl/exercises/pangram/pangram.tc +40 -0
  29. data/tracks/gnu-apl/exercises/raindrops/raindrops.tc +1 -1
  30. data/tracks/java/exercises/bracket-push/.meta/version +1 -0
  31. data/tracks/java/exercises/complex-numbers/.meta/version +1 -0
  32. data/tracks/java/exercises/ocr-numbers/.meta/version +1 -0
  33. data/tracks/java/exercises/queen-attack/.meta/version +1 -0
  34. data/tracks/java/exercises/rectangles/.meta/version +1 -0
  35. data/tracks/java/exercises/robot-simulator/.meta/version +1 -0
  36. data/tracks/java/exercises/secret-handshake/.meta/version +1 -0
  37. data/tracks/java/exercises/sublist/.meta/version +1 -0
  38. data/tracks/perl6/exercises/accumulate/accumulate.t +1 -6
  39. data/tracks/perl6/exercises/all-your-base/all-your-base.t +14 -19
  40. data/tracks/perl6/exercises/allergies/Allergies.pm6 +1 -1
  41. data/tracks/perl6/exercises/allergies/Example.pm6 +1 -1
  42. data/tracks/perl6/exercises/allergies/allergies.t +25 -29
  43. data/tracks/perl6/exercises/allergies/example.yaml +11 -10
  44. data/tracks/perl6/exercises/anagram/anagram.t +14 -19
  45. data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +14 -19
  46. data/tracks/perl6/exercises/bob/bob.t +16 -23
  47. data/tracks/perl6/exercises/bob/example.yaml +1 -3
  48. data/tracks/perl6/exercises/clock/clock.t +14 -19
  49. data/tracks/perl6/exercises/flatten-array/flatten-array.t +14 -19
  50. data/tracks/perl6/exercises/grade-school/grade-school.t +1 -6
  51. data/tracks/perl6/exercises/grains/grains.t +15 -20
  52. data/tracks/perl6/exercises/hello-world/example.yaml +1 -3
  53. data/tracks/perl6/exercises/hello-world/hello-world.t +16 -23
  54. data/tracks/perl6/exercises/leap/leap.t +14 -19
  55. data/tracks/perl6/exercises/linked-list/example.yaml +59 -59
  56. data/tracks/perl6/exercises/linked-list/linked-list.t +59 -64
  57. data/tracks/perl6/exercises/luhn/luhn.t +14 -19
  58. data/tracks/perl6/exercises/phone-number/phone-number.t +14 -19
  59. data/tracks/perl6/exercises/raindrops/raindrops.t +14 -19
  60. data/tracks/perl6/exercises/rna-transcription/rna-transcription.t +14 -19
  61. data/tracks/perl6/exercises/robot-name/robot-name.t +1 -6
  62. data/tracks/perl6/exercises/scrabble-score/scrabble-score.t +14 -19
  63. data/tracks/perl6/exercises/space-age/space-age.t +14 -19
  64. data/tracks/perl6/exercises/word-count/word-count.t +14 -19
  65. data/tracks/perl6/exercises/wordy/wordy.t +14 -19
  66. data/tracks/perl6/templates/test.mustache +19 -25
  67. data/tracks/purescript/config.json +12 -0
  68. data/tracks/purescript/exercises/sum-of-multiples/README.md +15 -0
  69. data/tracks/purescript/exercises/sum-of-multiples/bower.json +26 -0
  70. data/tracks/purescript/exercises/sum-of-multiples/examples/src/SumOfMultiples.purs +16 -0
  71. data/tracks/purescript/exercises/sum-of-multiples/src/SumOfMultiples.purs +3 -0
  72. data/tracks/purescript/exercises/sum-of-multiples/test/Main.purs +63 -0
  73. data/tracks/python/README.md +5 -1
  74. data/tracks/python/config.json +52 -9
  75. data/tracks/python/exercises/allergies/allergies_test.py +7 -7
  76. data/tracks/python/exercises/allergies/example.py +1 -1
  77. data/tracks/python/exercises/binary-search/binary_search_test.py +8 -5
  78. data/tracks/python/exercises/binary/binary_test.py +8 -4
  79. data/tracks/python/exercises/book-store/example.py +1 -1
  80. data/tracks/python/exercises/clock/clock.py +3 -0
  81. data/tracks/python/exercises/clock/clock_test.py +16 -16
  82. data/tracks/python/exercises/clock/example.py +1 -1
  83. data/tracks/python/exercises/list-ops/example.py +10 -29
  84. data/tracks/python/exercises/list-ops/list_ops.py +8 -12
  85. data/tracks/python/exercises/list-ops/list_ops_test.py +55 -86
  86. data/tracks/python/exercises/meetup/meetup_test.py +2 -2
  87. data/tracks/python/exercises/minesweeper/minesweeper_test.py +6 -3
  88. data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +11 -8
  89. data/tracks/python/exercises/pangram/pangram_test.py +25 -16
  90. data/tracks/python/exercises/point-mutations/point_mutations.py +1 -1
  91. data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet_test.py +2 -1
  92. data/tracks/python/exercises/saddle-points/saddle_points_test.py +2 -1
  93. data/tracks/python/exercises/simple-cipher/simple_cipher_test.py +4 -2
  94. data/tracks/python/exercises/triangle/triangle_test.py +10 -5
  95. data/tracks/python/exercises/wordy/wordy_test.py +8 -5
  96. data/tracks/python/exercises/zipper/README.md +43 -0
  97. data/tracks/python/exercises/zipper/example.py +41 -0
  98. data/tracks/python/exercises/zipper/zipper.py +28 -0
  99. data/tracks/python/exercises/zipper/zipper_test.py +82 -0
  100. data/tracks/racket/.travis.yml +1 -1
  101. data/tracks/racket/config.json +14 -0
  102. data/tracks/racket/exercises/meetup/README.md +54 -0
  103. data/tracks/racket/exercises/meetup/example.rkt +45 -0
  104. data/tracks/racket/exercises/meetup/meetup-test.rkt +39 -0
  105. data/tracks/racket/exercises/meetup/meetup.rkt +3 -0
  106. metadata +29 -2
@@ -13,7 +13,7 @@ class Clock(object):
13
13
  def __eq__(self, other):
14
14
  return repr(self) == repr(other)
15
15
 
16
- def add(self, minutes):
16
+ def __add__(self, minutes):
17
17
  self.minute += minutes
18
18
  return self.cleanup()
19
19
 
@@ -1,25 +1,21 @@
1
- def map_clone(function, xs):
2
- return [function(elem) for elem in xs]
1
+ def append(xs, ys):
2
+ return concat([xs, ys])
3
3
 
4
4
 
5
- def length(xs):
6
- return sum(1 for _ in xs)
5
+ def concat(lists):
6
+ return [elem for lst in lists for elem in lst]
7
7
 
8
8
 
9
9
  def filter_clone(function, xs):
10
10
  return [x for x in xs if function(x)]
11
11
 
12
12
 
13
- def reverse(xs):
14
- if not xs:
15
- return []
16
- else:
17
- return xs[::-1]
13
+ def length(xs):
14
+ return sum(1 for _ in xs)
18
15
 
19
16
 
20
- def append(xs, y):
21
- xs[len(xs):] = [y]
22
- return xs
17
+ def map_clone(function, xs):
18
+ return [function(elem) for elem in xs]
23
19
 
24
20
 
25
21
  def foldl(function, xs, acc):
@@ -36,20 +32,5 @@ def foldr(function, xs, acc):
36
32
  return function(xs[0], foldr(function, xs[1:], acc))
37
33
 
38
34
 
39
- def flat(xs):
40
- out = []
41
- for item in xs:
42
- if isinstance(item, list):
43
- out.extend(flat(item))
44
- else:
45
- out.append(item)
46
- return out
47
-
48
-
49
- def concat(xs, ys):
50
- if not ys:
51
- return xs
52
- else:
53
- for item in ys:
54
- xs.append(item)
55
- return xs
35
+ def reverse(xs):
36
+ return xs[::-1]
@@ -1,34 +1,30 @@
1
- def map_clone():
1
+ def append(xs, ys):
2
2
  pass
3
3
 
4
4
 
5
- def length():
5
+ def concat(lists):
6
6
  pass
7
7
 
8
8
 
9
- def filter_clone():
9
+ def filter_clone(function, xs):
10
10
  pass
11
11
 
12
12
 
13
- def reverse():
13
+ def length(xs):
14
14
  pass
15
15
 
16
16
 
17
- def append():
17
+ def map_clone(function, xs):
18
18
  pass
19
19
 
20
20
 
21
- def foldl():
21
+ def foldl(function, xs, acc):
22
22
  pass
23
23
 
24
24
 
25
- def foldr():
25
+ def foldr(function, xs, acc):
26
26
  pass
27
27
 
28
28
 
29
- def flat():
30
- pass
31
-
32
-
33
- def concat():
29
+ def reverse(xs):
34
30
  pass
@@ -4,122 +4,91 @@ import operator
4
4
  import list_ops
5
5
 
6
6
 
7
+ # Tests adapted from problem-specifications//canonical-data.json @ v2.0.0
8
+
7
9
  class ListOpsTest(unittest.TestCase):
8
10
 
9
- # tests for map
10
- def test_map_square(self):
11
- self.assertEqual(
12
- list_ops.map_clone(lambda x: x**2,
13
- [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
14
- [1, 4, 9, 16, 25, 36, 49, 64, 81, 100])
11
+ # test for append
12
+ def test_append_empty_lists(self):
13
+ self.assertEqual(list_ops.append([], []), [])
15
14
 
16
- def test_map_cube(self):
17
- self.assertEqual(
18
- list_ops.map_clone(lambda x: x**3,
19
- [-1, 2, -3, 4, -5, 6, -7, 8, -9, 10]),
20
- [-1, 8, -27, 64, -125, 216, -343, 512, -729, 1000])
15
+ def test_append_empty_list_to_list(self):
16
+ self.assertEqual(list_ops.append([], [1, 2, 3, 4]), [1, 2, 3, 4])
21
17
 
22
- def test_map_absolute(self):
23
- self.assertEqual(
24
- list_ops.map_clone(lambda x: abs(x),
25
- [-1, 2, -3, 4, -5, 6, -7, 8, -9, 10]),
26
- [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
18
+ def test_append_nonempty_lists(self):
19
+ self.assertEqual(list_ops.append([1, 2], [2, 3, 4, 5]),
20
+ [1, 2, 2, 3, 4, 5])
27
21
 
28
- def test_map_empty(self):
29
- self.assertEqual(list_ops.map_clone(operator.index, []), [])
22
+ # tests for concat
23
+ def test_concat_empty_list(self):
24
+ self.assertEqual(list_ops.concat([]), [])
30
25
 
31
- # tests for length
32
- def test_pos_leng(self):
33
- self.assertEqual(
34
- list_ops.length([-1, 2, -3, 4, -5, 6, -7, 8, -9, 10]), 10)
26
+ def test_concat_list_of_lists(self):
27
+ self.assertEqual(list_ops.concat([[1, 2], [3], [], [4, 5, 6]]),
28
+ [1, 2, 3, 4, 5, 6])
35
29
 
36
- def test_empty_len(self):
37
- self.assertEqual(list_ops.length([]), 0)
30
+ # tests for filter_clone
31
+ def test_filter_empty_list(self):
32
+ self.assertEqual(list_ops.filter_clone(lambda x: x % 2 == 1, []), [])
38
33
 
39
- # tests for filter
40
- def test_filter_odd(self):
34
+ def test_filter_nonempty_list(self):
41
35
  self.assertEqual(
42
- list_ops.filter_clone(lambda x: x % 2 != 0, [1, 2, 3, 4, 5, 6]),
36
+ list_ops.filter_clone(lambda x: x % 2 == 1, [1, 2, 3, 4, 5]),
43
37
  [1, 3, 5])
44
38
 
45
- def test_filter_even(self):
46
- self.assertEqual(
47
- list_ops.filter_clone(lambda x: x % 2 == 0, [1, 2, 3, 4, 5, 6]),
48
- [2, 4, 6])
49
-
50
- # tests for reverse
51
- def test_reverse_small(self):
52
- self.assertEqual(list_ops.reverse([3, 2, 1]), [1, 2, 3])
53
-
54
- def test_reverse_mixed_types(self):
55
- self.assertEqual(
56
- list_ops.reverse(["xyz", 4.0, "cat", 1]), [1, "cat", 4.0, "xyz"])
57
-
58
- def test_reverse_empty(self):
59
- self.assertEqual(list_ops.reverse([]), [])
39
+ # tests for length
40
+ def test_length_empty_list(self):
41
+ self.assertEqual(list_ops.length([]), 0)
60
42
 
61
- # tests for append
62
- def test_append_tuple(self):
63
- self.assertEqual(
64
- list_ops.append(["10", "python"], "hello"),
65
- ["10", "python", "hello"])
43
+ def test_length_nonempty_list(self):
44
+ self.assertEqual(list_ops.length([1, 2, 3, 4]), 4)
66
45
 
67
- def test_append_range(self):
68
- self.assertEqual(
69
- list_ops.append([100], range(1000)), [100, range(1000)])
46
+ # tests for map_clone
47
+ def test_map_empty_list(self):
48
+ self.assertEqual(list_ops.map_clone(lambda x: x + 1, []), [])
70
49
 
71
- def test_append_to_empty(self):
72
- self.assertEqual(list_ops.append([], 42), [42])
50
+ def test_map_nonempty_list(self):
51
+ self.assertEqual(list_ops.map_clone(lambda x: x + 1, [1, 3, 5, 7]),
52
+ [2, 4, 6, 8])
73
53
 
74
54
  # tests for foldl
75
- def test_foldl_sum(self):
76
- self.assertEqual(
77
- list_ops.foldl(operator.add, [1, 2, 3, 4, 5, 6], 0), 21)
55
+ def test_foldl_empty_list(self):
56
+ self.assertEqual(list_ops.foldl(operator.mul, [], 2), 2)
78
57
 
79
- def test_foldl_product(self):
80
- self.assertEqual(
81
- list_ops.foldl(operator.mul, [1, 2, 3, 4, 5, 6], 1), 720)
58
+ def test_foldl_nonempty_list_addition(self):
59
+ self.assertEqual(list_ops.foldl(operator.add, [1, 2, 3, 4], 5), 15)
82
60
 
83
- def test_foldl_div(self):
84
- self.assertEqual(
85
- list_ops.foldl(operator.floordiv, [1, 2, 3, 4, 5, 6], 1), 0)
86
-
87
- def test_foldl_sub(self):
88
- self.assertEqual(list_ops.foldl(operator.sub, [1, 2, 3, 4, 5], 0), -15)
61
+ def test_foldl_nonempty_list_floordiv(self):
62
+ self.assertEqual(list_ops.foldl(operator.floordiv, [2, 5], 5), 0)
89
63
 
90
64
  # tests for foldr
91
- def test_foldr_sub(self):
92
- self.assertEqual(list_ops.foldr(operator.sub, [1, 2, 3, 4, 5], 0), 3)
65
+ def test_foldr_empty_list(self):
66
+ self.assertEqual(list_ops.foldr(operator.mul, [], 2), 2)
67
+
68
+ def test_foldr_nonempty_list_addition(self):
69
+ self.assertEqual(list_ops.foldr(operator.add, [1, 2, 3, 4], 5), 15)
70
+
71
+ def test_foldr_nonempty_list_floordiv(self):
72
+ self.assertEqual(list_ops.foldr(operator.floordiv, [2, 5], 5), 2)
93
73
 
74
+ # additional test for foldr
94
75
  def test_foldr_add_str(self):
95
76
  self.assertEqual(
96
77
  list_ops.foldr(operator.add,
97
78
  ["e", "x", "e", "r", "c", "i", "s", "m"], "!"),
98
79
  "exercism!")
99
80
 
100
- # tests for flatten
101
- def test_flatten_nested(self):
102
- self.assertEqual(list_ops.flat([[[1, 2], [3]], [[4]]]), [1, 2, 3, 4])
103
-
104
- def test_flatten_once(self):
105
- self.assertEqual(list_ops.flat([["x", "y", "z"]]), ["x", "y", "z"])
81
+ # tests for reverse
82
+ def test_reverse_empty_list(self):
83
+ self.assertEqual(list_ops.reverse([]), [])
106
84
 
107
- def test_flatten_empty(self):
108
- self.assertEqual(list_ops.flat([]), [])
85
+ def test_reverse_nonempty_list(self):
86
+ self.assertEqual(list_ops.reverse([1, 3, 5, 7]), [7, 5, 3, 1])
109
87
 
110
- # tests for concat
111
- def test_concat_two(self):
112
- self.assertEqual(
113
- list_ops.concat([1, 3, 5, 8], [9, 4, 5, 6]),
114
- [1, 3, 5, 8, 9, 4, 5, 6])
115
-
116
- def test_concat_nothing(self):
88
+ # additional test for reverse
89
+ def test_reverse_mixed_types(self):
117
90
  self.assertEqual(
118
- list_ops.concat(['orange', 'apple', 'banana'], None),
119
- ["orange", "apple", "banana"])
120
-
121
- def test_concat_empty(self):
122
- self.assertEqual(list_ops.concat([], []), [])
91
+ list_ops.reverse(["xyz", 4.0, "cat", 1]), [1, "cat", 4.0, "xyz"])
123
92
 
124
93
 
125
94
  if __name__ == '__main__':
@@ -399,8 +399,8 @@ class MeetupTest(unittest.TestCase):
399
399
  meetup_day(2015, 3, 'Monday', '5th'), date(2015, 3, 30))
400
400
 
401
401
  def test_nonexistent_fifth_monday_of_february_2015(self):
402
- self.assertRaises(MeetupDayException, meetup_day, 2015, 2, 'Monday',
403
- '5th')
402
+ with self.assertRaises(MeetupDayException):
403
+ meetup_day(2015, 2, 'Monday', '5th')
404
404
 
405
405
 
406
406
  if __name__ == '__main__':
@@ -141,19 +141,22 @@ class MinesweeperTest(unittest.TestCase):
141
141
  "|* |",
142
142
  "| |",
143
143
  "+-+"]
144
- self.assertRaises(ValueError, board, inp)
144
+ with self.assertRaises(ValueError):
145
+ board(inp)
145
146
 
146
147
  def test_faulty_border(self):
147
148
  inp = ["+-----+",
148
149
  "* * |",
149
150
  "+-- --+"]
150
- self.assertRaises(ValueError, board, inp)
151
+ with self.assertRaises(ValueError):
152
+ board(inp)
151
153
 
152
154
  def test_invalid_char(self):
153
155
  inp = ["+-----+",
154
156
  "|X * |",
155
157
  "+-----+"]
156
- self.assertRaises(ValueError, board, inp)
158
+ with self.assertRaises(ValueError):
159
+ board(inp)
157
160
 
158
161
 
159
162
  if __name__ == '__main__':
@@ -43,15 +43,17 @@ class OcrTest(unittest.TestCase):
43
43
  " "]), '?')
44
44
 
45
45
  def test_too_short_row(self):
46
- self.assertRaises(ValueError, number, [" ",
47
- " _|",
48
- " |",
49
- " "])
46
+ with self.assertRaises(ValueError):
47
+ number([" ",
48
+ " _|",
49
+ " |",
50
+ " "])
50
51
 
51
52
  def test_insufficient_rows(self):
52
- self.assertRaises(ValueError, number, [" ",
53
- " _|",
54
- " X|"])
53
+ with self.assertRaises(ValueError):
54
+ number([" ",
55
+ " _|",
56
+ " X|"])
55
57
 
56
58
  def test_grid0(self):
57
59
  self.assertEqual(grid('0'), [" _ ",
@@ -114,7 +116,8 @@ class OcrTest(unittest.TestCase):
114
116
  ])
115
117
 
116
118
  def test_invalid_grid(self):
117
- self.assertRaises(ValueError, grid, '123a')
119
+ with self.assertRaises(ValueError):
120
+ grid('123a')
118
121
 
119
122
 
120
123
  if __name__ == '__main__':
@@ -7,39 +7,48 @@ from pangram import is_pangram
7
7
 
8
8
  class PangramTests(unittest.TestCase):
9
9
  def test_sentence_empty(self):
10
- self.assertFalse(is_pangram(''))
10
+ self.assertIs(is_pangram(''), False)
11
11
 
12
12
  def test_pangram_with_only_lower_case(self):
13
- self.assertTrue(
14
- is_pangram('the quick brown fox jumps over the lazy dog'))
13
+ self.assertIs(
14
+ is_pangram('the quick brown fox jumps over the lazy dog'),
15
+ True)
15
16
 
16
17
  def test_missing_character_x(self):
17
- self.assertFalse(
18
+ self.assertIs(
18
19
  is_pangram('a quick movement of the enemy will '
19
- 'jeopardize five gunboats'))
20
+ 'jeopardize five gunboats'),
21
+ False)
20
22
 
21
23
  def test_another_missing_character_x(self):
22
- self.assertFalse(
23
- is_pangram('the quick brown fish jumps over the lazy dog'))
24
+ self.assertIs(
25
+ is_pangram('the quick brown fish jumps over the lazy dog'),
26
+ False)
24
27
 
25
28
  def test_pangram_with_underscores(self):
26
- self.assertTrue(
27
- is_pangram('the_quick_brown_fox_jumps_over_the_lazy_dog'))
29
+ self.assertIs(
30
+ is_pangram('the_quick_brown_fox_jumps_over_the_lazy_dog'),
31
+ True)
28
32
 
29
33
  def test_pangram_with_numbers(self):
30
- self.assertTrue(
31
- is_pangram('the 1 quick brown fox jumps over the 2 lazy dogs'))
34
+ self.assertIs(
35
+ is_pangram('the 1 quick brown fox jumps over the 2 lazy dogs'),
36
+ True)
32
37
 
33
38
  def test_missing_letters_replaced_by_numbers(self):
34
- self.assertFalse(
35
- is_pangram('7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog'))
39
+ self.assertIs(
40
+ is_pangram('7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog'),
41
+ False)
36
42
 
37
43
  def test_pangram_with_mixedcase_and_punctuation(self):
38
- self.assertTrue(is_pangram('"Five quacking Zephyrs jolt my wax bed."'))
44
+ self.assertIs(
45
+ is_pangram('"Five quacking Zephyrs jolt my wax bed."'),
46
+ True)
39
47
 
40
48
  def test_upper_and_lower_case_versions_of_the_same_character(self):
41
- self.assertFalse(
42
- is_pangram('the quick brown fox jumped over the lazy FOX'))
49
+ self.assertIs(
50
+ is_pangram('the quick brown fox jumped over the lazy FOX'),
51
+ False)
43
52
 
44
53
 
45
54
  if __name__ == '__main__':
@@ -1,2 +1,2 @@
1
- def hamming_distance():
1
+ def hamming_distance(dna_strand_1, dna_strand_2):
2
2
  pass
@@ -80,7 +80,8 @@ class PythagoreanTripletTest(unittest.TestCase):
80
80
  self.assertIs(is_triplet((924, 43, 925)), True)
81
81
 
82
82
  def test_odd_number(self):
83
- self.assertRaises(ValueError, primitive_triplets, 5)
83
+ with self.assertRaises(ValueError):
84
+ primitive_triplets(5)
84
85
 
85
86
 
86
87
  if __name__ == '__main__':
@@ -28,7 +28,8 @@ class SaddlePointTest(unittest.TestCase):
28
28
 
29
29
  def test_irregular_matrix(self):
30
30
  inp = [[3, 2, 1], [0, 1], [2, 1, 0]]
31
- self.assertRaises(ValueError, saddle_points, inp)
31
+ with self.assertRaises(ValueError):
32
+ saddle_points(inp)
32
33
 
33
34
 
34
35
  if __name__ == '__main__':