-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from metabrainz/integration-fixes
Integration fixes
- Loading branch information
Showing
23 changed files
with
552 additions
and
685 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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
|
||
from troi.plist import plist | ||
|
||
|
||
class TestSplitter(unittest.TestCase): | ||
|
||
def test_plist(self): | ||
pl = plist([0,1,2,3,4,5,6,7,8,9]) | ||
|
||
assert pl[0:10] == [0] | ||
assert pl[0:20] == [0,1] | ||
assert pl[50:100] == [5,6,7,8,9] | ||
assert pl.uslice(0, 10) == [0] | ||
assert pl.uslice(0, 20) == [0,1] | ||
assert pl.uslice(50, 100) == [5,6,7,8,9] | ||
|
||
assert pl.dslice(0, 2) == [0,1] | ||
|
||
assert pl.random_item(50, 100) in [5,6,7,8,9] | ||
|
||
def test_plist_unique(self): | ||
pl = plist([0,1,2,3,4,5,6,7,8,9]) | ||
rlist = pl.random_item(count=9) | ||
assert len(rlist) == len(set(rlist)) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.