@@ -365,15 +365,19 @@ Respect remote PYTHONPATH value."
365365 (setq tramp-current-connection)
366366 (sleep-for 0.5 )))
367367
368- (ert-deftest test-start-pythonic-default-directory-property ()
369- " Set `pythonic-default-directory' result as `default-directory' process property."
370- (let ((default-directorys " ~" ))
371- (should (equal (f-full " ~" )
372- (plist-get
373- (process-get
374- (start-pythonic :process " out" :args '(" -V" ))
375- 'pythonic )
376- :default-directory )))))
368+ (ert-deftest test-start-pythonic-connection-property ()
369+ " Set `pythonic-tramp-connection' result as `connection' process property."
370+ (unwind-protect
371+ (let ((python-shell-interpreter " /ssh:test@localhost:/path/to/the/python" ))
372+ (should (equal " /ssh:test@localhost:"
373+ (plist-get
374+ (process-get
375+ (start-pythonic :process " out" :args '(" -V" ))
376+ 'pythonic )
377+ :connection ))))
378+ (kill-buffer " *tramp/ssh test@localhost*" )
379+ (setq tramp-current-connection)
380+ (sleep-for 0.5 )))
377381
378382(ert-deftest test-start-pythonic-environment-property ()
379383 " Set `python-shell-process-environment' as `environment' process property."
@@ -416,6 +420,16 @@ change since process was start."
416420 (python-shell-process-environment '(" TEST=t" )))
417421 (should-not (pythonic-proper-environment-p process))))
418422
423+ (ert-deftest test-pythonic-proper-environment-p-change-host ()
424+ " `pythonic-proper-environment-p' is null if tramp host was changed."
425+ ; ; `unwind-protect' block is unnecessary here because non of tramp
426+ ; ; connection will be opened below. First process starts locally,
427+ ; ; proper environment check will stop at connection strings
428+ ; ; comparison, non of remote PATH or PYTHONPATH checks will be made.
429+ (let* ((process (start-pythonic :process " out" :args '(" -V" )))
430+ (python-shell-interpreter " /ssh:test@localhost:/path/to/the/python" ))
431+ (should-not (pythonic-proper-environment-p process))))
432+
419433; ;; Activate/deactivate environment.
420434
421435(ert-deftest test-pythonic-activate ()
0 commit comments