예제 #1
0
def test_rpm_detect():
    from rosdep2.platforms.redhat import rpm_detect

    m = Mock()
    m.return_value = ''

    val = rpm_detect([], exec_fn=m)
    assert val == [], val

    val = rpm_detect(['tinyxml-dev'], exec_fn=m)
    assert val == [], val
예제 #2
0
def test_rpm_detect():
    from rosdep2.platforms.redhat import rpm_detect

    m = Mock()
    m.return_value = ''

    val = rpm_detect([], exec_fn=m)
    assert val == [], val

    val = rpm_detect(['tinyxml-dev'], exec_fn=m)
    assert val == [], val
예제 #3
0
def test_rpm_detect():
    from rosdep2.platforms.redhat import rpm_detect

    m = Mock()
    m.return_value = ''

    val = rpm_detect([], exec_fn=m)
    assert val == [], val

    # Negitive case test. rpms use devel, rather than dev
    with open(os.path.join(get_test_dir(), 'rpm-q-tinyxml-dev'), 'r') as f:
        m.return_value = f.read()
    val = rpm_detect(['tinyxml-dev'], exec_fn=m)
    assert val == [], val

    # Positive case test. rpm should always be installed if you're attempting to detect rpms
    with open(os.path.join(get_test_dir(), 'rpm-q-rpm'), 'r') as f:
        m.return_value = f.read()
    val = rpm_detect(['rpm'], exec_fn=m)
    assert val == ['rpm'], val
예제 #4
0
def test_rpm_detect():
    from rosdep2.platforms.redhat import rpm_detect

    m = Mock()
    m.return_value = ''

    val = rpm_detect([], exec_fn=m)
    assert val == [], val

    # Negitive case test. rpms use devel, rather than dev
    with open(os.path.join(get_test_dir(), 'rpm-q-tinyxml-dev'), 'r') as f:
        m.return_value = f.read()
    val = rpm_detect(['tinyxml-dev'], exec_fn=m)
    assert val == [], val

    # Positive case test. rpm should always be installed if you're attempting to detect rpms
    with open(os.path.join(get_test_dir(), 'rpm-q-rpm'), 'r') as f:
        m.return_value = f.read()
    val = rpm_detect(['rpm'], exec_fn=m)
    assert val == ['rpm'], val