-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
1 parent
cd47701
commit bb5bc1f
Showing
7 changed files
with
34 additions
and
73 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
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 |
---|---|---|
@@ -1,28 +1,25 @@ | ||
from . import unittest | ||
|
||
|
||
class TestPackage(unittest.TestCase): | ||
class TestPackage: | ||
def test_top_level_namespace(self): | ||
import kafka as kafka1 | ||
self.assertEqual(kafka1.KafkaConsumer.__name__, "KafkaConsumer") | ||
self.assertEqual(kafka1.consumer.__name__, "kafka.consumer") | ||
self.assertEqual(kafka1.codec.__name__, "kafka.codec") | ||
assert kafka1.KafkaConsumer.__name__ == "KafkaConsumer" | ||
assert kafka1.consumer.__name__ == "kafka.consumer" | ||
assert kafka1.codec.__name__ == "kafka.codec" | ||
|
||
def test_submodule_namespace(self): | ||
import kafka.client as client1 | ||
self.assertEqual(client1.__name__, "kafka.client") | ||
assert client1.__name__ == "kafka.client" | ||
|
||
from kafka import client as client2 | ||
self.assertEqual(client2.__name__, "kafka.client") | ||
assert client2.__name__ == "kafka.client" | ||
|
||
from kafka.client import SimpleClient as SimpleClient1 | ||
self.assertEqual(SimpleClient1.__name__, "SimpleClient") | ||
assert SimpleClient1.__name__ == "SimpleClient" | ||
|
||
from kafka.codec import gzip_encode as gzip_encode1 | ||
self.assertEqual(gzip_encode1.__name__, "gzip_encode") | ||
assert gzip_encode1.__name__ == "gzip_encode" | ||
|
||
from kafka import SimpleClient as SimpleClient2 | ||
self.assertEqual(SimpleClient2.__name__, "SimpleClient") | ||
assert SimpleClient2.__name__ == "SimpleClient" | ||
|
||
from kafka.codec import snappy_encode | ||
self.assertEqual(snappy_encode.__name__, "snappy_encode") | ||
assert snappy_encode.__name__ == "snappy_encode" |
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