Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

largest-series-product: Do not test slices #316

Merged
merged 1 commit into from
Mar 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions exercises/largest-series-product/largest_series_product_test.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
"""Tests for the largest-series-product exercise

Implementation note:
In case of invalid inputs to the 'slices' or 'largest_product' functions
In case of invalid inputs to the 'largest_product' function
your program should raise a ValueError with a meaningful error message.

Feel free to reuse your code for the series exercise!
"""
import unittest

from series import largest_product, slices
from series import largest_product


class SeriesTest(unittest.TestCase):
def test_slices_of_two(self):
self.assertEqual([[9, 7], [7, 8], [8, 6], [6, 7],
[7, 5], [5, 6], [6, 4]],
slices("97867564", 2))

def test_overly_long_slice(self):
with self.assertRaises(ValueError):
slices("012", 4)

def test_largest_product_of_2(self):
self.assertEqual(72, largest_product("0123456789", 2))

Expand Down