File: test_misc.py

package info (click to toggle)
python-easydev 0.13.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: python: 1,904; makefile: 116; javascript: 49
file content (27 lines) | stat: -rw-r--r-- 567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os.path

# from unittest.mock import patch
import subprocess

from easydev.misc import cmd_exists, get_home, in_ipynb


def test_get_home():
    get_home()

    # with patch.object(os.path, 'expanduser') as mymock:
    #    mymock.side_effect = ImportError
    #    get_home()


def test_cmd_exists():
    assert cmd_exists("dummy_dummy") == False
    assert cmd_exists("ls") == True

    # with patch.object(subprocess, 'call') as mymock:
    #    mymock.side_effect = Exception
    #    cmd_exists('ls')


def test_in_ipynb():
    assert in_ipynb() == False