-
Notifications
You must be signed in to change notification settings - Fork 39
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
01ef31a
commit 6a931d4
Showing
4 changed files
with
71 additions
and
8 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,18 @@ | ||
import unittest | ||
|
||
import docker | ||
|
||
|
||
class ToxDockerPortTest(unittest.TestCase): | ||
|
||
def test_it_exposes_only_specified_port(self): | ||
client = docker.from_env(version="auto") | ||
mysql_container = None | ||
for container in client.containers.list() | ||
if "mysql" in containers.attrs["Config"]["Image"]: | ||
mysql_container = container | ||
break | ||
|
||
self.assertIsNotNone(mysql_container, "could not find mysql container") | ||
self.assertIsNotNone(mysql_container.attrs["NetworkSettings"]["Ports"].get("3306/tcp")) | ||
self.assertIsNone(mysql_container.attrs["NetworkSettings"]["Ports"].get("33060/tcp")) |
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