Pārlūkot izejas kodu

Add test_uses_c() to TestPyTokenizer and TestCTokenizer

tags/v0.2
Ben Kurtovic pirms 11 gadiem
vecāks
revīzija
27a3503aa1
2 mainītis faili ar 14 papildinājumiem un 2 dzēšanām
  1. +7
    -1
      tests/test_ctokenizer.py
  2. +7
    -1
      tests/test_pytokenizer.py

+ 7
- 1
tests/test_ctokenizer.py Parādīt failu

@@ -23,6 +23,8 @@
from __future__ import unicode_literals
import unittest

from mwparserfromhell.parser._tokenizer import CTokenizer

from _test_tokenizer import TokenizerTestCase

class TestCTokenizer(TokenizerTestCase, unittest.TestCase):
@@ -30,8 +32,12 @@ class TestCTokenizer(TokenizerTestCase, unittest.TestCase):

@classmethod
def setUpClass(cls):
from mwparserfromhell.parser._tokenizer import CTokenizer
cls.tokenizer = CTokenizer

def test_uses_c(self):
"""make sure the C tokenizer identifies as using a C extension"""
self.assertTrue(CTokenizer.USES_C)
self.assertTrue(CTokenizer().USES_C)

if __name__ == "__main__":
unittest.main(verbosity=2)

+ 7
- 1
tests/test_pytokenizer.py Parādīt failu

@@ -23,6 +23,8 @@
from __future__ import unicode_literals
import unittest

from mwparserfromhell.parser.tokenizer import Tokenizer

from _test_tokenizer import TokenizerTestCase

class TestPyTokenizer(TokenizerTestCase, unittest.TestCase):
@@ -30,8 +32,12 @@ class TestPyTokenizer(TokenizerTestCase, unittest.TestCase):

@classmethod
def setUpClass(cls):
from mwparserfromhell.parser.tokenizer import Tokenizer
cls.tokenizer = Tokenizer

def test_uses_c(self):
"""make sure the Python tokenizer identifies as not using C"""
self.assertFalse(Tokenizer.USES_C)
self.assertFalse(Tokenizer().USES_C)

if __name__ == "__main__":
unittest.main(verbosity=2)

Notiek ielāde…
Atcelt
Saglabāt