-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove code with no tests. Add test for one piece of code.
- Loading branch information
Shyue Ping Ong
committed
Aug 2, 2023
1 parent
6eb73b8
commit f392caa
Showing
2 changed files
with
10 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
# Copyright (c) Materials Virtual Lab. | ||
# Distributed under the terms of the BSD License. | ||
|
||
""" | ||
#TODO: Replace with proper module doc. | ||
""" | ||
from monty.itertools import chunks, iterator_from_slice | ||
|
||
import unittest | ||
|
||
from monty.itertools import iterator_from_slice | ||
def test_iterator_from_slice(): | ||
assert list(iterator_from_slice(slice(0, 6, 2))) == [0, 2, 4] | ||
|
||
|
||
class FuncTest(unittest.TestCase): | ||
def test_iterator_from_slice(self): | ||
self.assertEqual(list(iterator_from_slice(slice(0, 6, 2))), [0, 2, 4]) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() | ||
def test_chunks(): | ||
assert list(chunks(range(1, 25), 10)) == [ | ||
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), | ||
(11, 12, 13, 14, 15, 16, 17, 18, 19, 20), | ||
(21, 22, 23, 24), | ||
] |