mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-01-29 05:40:42 +00:00
Move all tests to single directory
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
5
tests/data/contacts.vcf
Normal file
5
tests/data/contacts.vcf
Normal file
@@ -0,0 +1,5 @@
|
||||
BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
FN:Sample Contact
|
||||
TEL;TYPE=CELL:+85288888888
|
||||
END:VCARD
|
||||
@@ -4,7 +4,7 @@ import tempfile
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
from brazilian_number_processing import process_phone_number, process_vcard
|
||||
from scripts.brazilian_number_processing import process_phone_number, process_vcard
|
||||
|
||||
class TestVCardProcessor(unittest.TestCase):
|
||||
|
||||
@@ -248,7 +248,7 @@ END:VCARD
|
||||
output_path = input_path + '.out'
|
||||
|
||||
try:
|
||||
test_args = ['python' if os.name == 'nt' else 'python3', 'brazilian_number_processing.py', input_path, output_path]
|
||||
test_args = ['python' if os.name == 'nt' else 'python3', 'scripts/brazilian_number_processing.py', input_path, output_path]
|
||||
# We're just testing that the argument parsing works
|
||||
subprocess.call(
|
||||
test_args,
|
||||
@@ -1,10 +1,12 @@
|
||||
# from contacts_names_from_vcards import readVCardsFile
|
||||
|
||||
import os
|
||||
from Whatsapp_Chat_Exporter.vcards_contacts import normalize_number, read_vcards_file
|
||||
|
||||
|
||||
def test_readVCardsFile():
|
||||
assert len(read_vcards_file("contacts.vcf", "973")) > 0
|
||||
data_dir = os.path.join(os.path.dirname(__file__), "data")
|
||||
assert len(read_vcards_file(os.path.join(data_dir, "contacts.vcf"), "852")) > 0
|
||||
|
||||
def test_create_number_to_name_dicts():
|
||||
pass
|
||||
Reference in New Issue
Block a user