Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 057ce98

Browse files
committed
set TEST_WHOIS_PYTHON to path so we can switch the type of testing later
1 parent 069ac52 commit 057ce98

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

test.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#! /usr/bin/bash
22

33
# signal whois module that we are testing, this reads data from testdata/<domain>/in
4-
export TEST_WHOIS_PYTHON="1"
5-
6-
TestDataDir="./testdata"
4+
TestDataDir=$(realpath ./testdata)
5+
export TEST_WHOIS_PYTHON="$TestDataDir"
76

87
get_testdomains()
98
{

whois/_1_query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def testWhoisPythonFromStaticTestData(
120120
verbose: bool = False,
121121
) -> str:
122122
domain = ".".join(dl)
123-
124-
pathToTestFile = f"./testdata/{domain}/input"
123+
testDir = os.getenv("TEST_WHOIS_PYTHON")
124+
pathToTestFile = f"{testDir}/{domain}/input"
125125
if os.path.exists(pathToTestFile):
126126
with open(pathToTestFile, mode="rb") as f: # switch to binary mode as that is what Popen uses
127127
# make sure the data is treated exactly the same as the output of Popen

0 commit comments

Comments
 (0)