Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
fordnox committed Dec 7, 2023
1 parent 9347b08 commit 4eaba04
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
39 changes: 23 additions & 16 deletions tests/wordplex_test.py
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"

1 change: 1 addition & 0 deletions wordplex/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .wordplex import WordPlex
1 change: 1 addition & 0 deletions wordplex/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

from .wordplex import WordPlex

_format = sys.argv[1]
Expand Down

0 comments on commit 4eaba04

Please sign in to comment.