-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,46 @@ | ||
from wordplex import Wordplex | ||
from wordplex import WordPlex | ||
|
||
wordplex = Wordplex() | ||
wp = WordPlex() | ||
|
||
|
||
def test_count_vowels(): | ||
assert len(wordplex.vowels) == 5 | ||
assert len(wp.vowels) == 6 | ||
|
||
|
||
def test_count_consonants(): | ||
assert len(wordplex.consonants) == 21 | ||
assert len(wp.consonants) == 20 | ||
|
||
|
||
def test_count_numbers(): | ||
assert len(wordplex.numbers) == 10 | ||
assert len(wp.numbers) == 10 | ||
|
||
|
||
def test_count_letters(): | ||
assert len(wordplex.letters) == 10 | ||
assert len(wp.letters) == 26 | ||
|
||
|
||
def test_default_format(): | ||
assert wordplex.get_format() == "VC" | ||
assert wp.get_format() == "VC" | ||
|
||
|
||
def test_pattern(): | ||
wordplex.setFormat("@#") | ||
assert wordplex.get_pattern() == "VC" | ||
wp.set_format("@") | ||
assert wp.get_pattern() == [wp.letters] | ||
|
||
wp.set_format("#") | ||
assert wp.get_pattern() == [wp.numbers] | ||
|
||
def test_set_format(): | ||
wordplex.setFormat("CVV") | ||
assert wordplex.get_format() == "CVV" | ||
wp.set_format("C") | ||
assert wp.get_pattern() == [wp.consonants] | ||
|
||
wp.set_format("V") | ||
assert wp.get_pattern() == [wp.vowels] | ||
|
||
wp.set_format("VC") | ||
assert wp.get_pattern() == [wp.vowels, wp.consonants] | ||
|
||
|
||
def test_set_prefix(): | ||
wordplex.set_prefix("i") | ||
# Assuming the test passes as there's no specified check in the original test | ||
assert True | ||
def test_set_format(): | ||
wp.set_format("CVV") | ||
assert wp.get_format() == "CVV" | ||
|
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 @@ | ||
from .wordplex import WordPlex |
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,4 +1,5 @@ | ||
import sys | ||
|
||
from .wordplex import WordPlex | ||
|
||
_format = sys.argv[1] | ||
|