This repository has been archived by the owner on Feb 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for utils.count. Fix case transform in count functions
Also, edit test_utils_validate.py to add correct references in documentation.
- Loading branch information
Kaustav Das Modak
committed
Jan 20, 2013
1 parent
6cfef9f
commit dd5b1cb
Showing
3 changed files
with
49 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Provides test cases for pyavrophonetic.avro.utils.count | ||
------------------------------------------------------------------------------- | ||
Copyright (C) 2013 Kaustav Das Modak <[email protected]. | ||
This file is part of pyAvroPhonetic. | ||
pyAvroPhonetic is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
pyAvroPhonetic is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with pyAvroPhonetic. If not, see <http://www.gnu.org/licenses/>. | ||
""" | ||
|
||
# Imports | ||
import unittest | ||
from pyavrophonetic.utils import count | ||
|
||
|
||
class TestUtilsCount(unittest.TestCase): | ||
"""Tests validation methods for pyavrophonetic.utils.count""" | ||
|
||
def test_count_vowels(self): | ||
"""Test vowel count in a given string""" | ||
self.assertEquals(count.count_vowels('haTTima Tim Tim'), 5) | ||
self.assertEquals(count.count_vowels('tara maThe paRe Dim'), 7) | ||
self.assertEquals(count.count_vowels('tader mathay duTO sing'), 7) | ||
self.assertEquals(count.count_vowels('tara haTTima Tim Tim'), 7) | ||
|
||
def test_count_consonants(self): | ||
"""Test consonant count in a given string""" | ||
self.assertEquals(count.count_consonants('ei dekh pensil'), 7) | ||
self.assertEquals(count.count_consonants('nOTbuk e hate'), 6) | ||
self.assertEquals(count.count_consonants('ei dekh bhora sob'), 8) | ||
self.assertEquals(count.count_consonants('kil`bil lekha te'), 8) |
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