File tree Expand file tree Collapse file tree 3 files changed +2
-31
lines changed Expand file tree Collapse file tree 3 files changed +2
-31
lines changed Original file line number Diff line number Diff line change 1111"""
1212
1313import re
14- from pprint import pprint
14+
1515from .rshell import CalledProcessError , shell , log_progress
1616
1717
1818def perform_initial_checks (mail_domain , pre_command = "" ):
1919 """Collecting initial DNS settings."""
2020 assert mail_domain
21- pprint ("rdns.perform_initial_checks: " + shell .__module__ )
22-
2321 if not shell ("dig" , fail_ok = True , print = log_progress ):
2422 shell ("apt-get update && apt-get install -y dnsutils" , print = log_progress )
2523 A = query_dns ("A" , mail_domain )
Original file line number Diff line number Diff line change 11import sys
2- from pprint import pprint
2+
33from subprocess import DEVNULL , CalledProcessError , check_output
44
55
@@ -9,7 +9,6 @@ def log_progress(data):
99
1010
1111def shell (command , fail_ok = False , print = print ):
12- pprint ("test_cmdeploy: " + shell .__module__ )
1312 print (f"$ { command } " )
1413 args = dict (shell = True )
1514 if fail_ok :
Original file line number Diff line number Diff line change 55
66from cmdeploy .cmdeploy import get_parser , main
77from cmdeploy .www import get_paths
8- import cmdeploy .remote .rshell
9- import cmdeploy .dns
108
119
1210@pytest .fixture (autouse = True )
@@ -61,27 +59,3 @@ def test_www_folder(example_config, tmp_path):
6159 assert www_path == tmp_path
6260 assert src_dir == src_path
6361 assert build_dir == tmp_path .joinpath ("build" )
64-
65-
66- def test_dns_when_ssh_docker (monkeypatch ):
67- commands = []
68-
69- def shell (command , fail_ok = None , print = None ):
70- assert command == False
71- commands .append (command )
72-
73- # mock shell function to add called commands to a global list
74- monkeypatch .setattr (
75- cmdeploy .remote .rshell , shell .__name__ , shell
76- ) # still doesn't get called in get_initial_remote_data :(
77- print ("test_cmdeploy: " + shell .__module__ )
78- # run cmdeploy dns with --ssh-host
79- # @docker
80- cmdeploy .dns .get_initial_remote_data ("@docker" , "chatmail.example.org" )
81- for cmd in commands :
82- print (cmd )
83- # localhost
84- # @local
85- # without --ssh-host
86- # check which commands were called
87- assert False
You can’t perform that action at this time.
0 commit comments