import socket
import cdj

HOST = socket.gethostname()
BAD_SERVER = (HOST, 10000)
GOOD_SERVER = (HOST, 10001)


def test_pong():

    @cdj.call(server=GOOD_SERVER)
    def foo():
        return 'foo fallback'

    assert foo() == 'pong'


def test_fallback():

    @cdj.call(server=BAD_SERVER)
    def bar():
        return 'bar fallback'

    assert bar() == 'bar fallback'

45a33706e2b20cc2f394c51d1973c1ec214a324c
<mask token>


def test_pong():

    @cdj.call(server=GOOD_SERVER)
    def foo():
        return 'foo fallback'
    assert foo() == 'pong'


<mask token>

<mask token>


def test_pong():

    @cdj.call(server=GOOD_SERVER)
    def foo():
        return 'foo fallback'
    assert foo() == 'pong'


def test_fallback():

    @cdj.call(server=BAD_SERVER)
    def bar():
        return 'bar fallback'
    assert bar() == 'bar fallback'

<mask token>
HOST = socket.gethostname()
BAD_SERVER = HOST, 10000
GOOD_SERVER = HOST, 10001


def test_pong():

    @cdj.call(server=GOOD_SERVER)
    def foo():
        return 'foo fallback'
    assert foo() == 'pong'


def test_fallback():

    @cdj.call(server=BAD_SERVER)
    def bar():
        return 'bar fallback'
    assert bar() == 'bar fallback'

import socket
import cdj
HOST = socket.gethostname()
BAD_SERVER = HOST, 10000
GOOD_SERVER = HOST, 10001


def test_pong():

    @cdj.call(server=GOOD_SERVER)
    def foo():
        return 'foo fallback'
    assert foo() == 'pong'


def test_fallback():

    @cdj.call(server=BAD_SERVER)
    def bar():
        return 'bar fallback'
    assert bar() == 'bar fallback'

import socket
import cdj

HOST = socket.gethostname()
BAD_SERVER = (HOST, 10000)
GOOD_SERVER = (HOST, 10001)


def test_pong():

    @cdj.call(server=GOOD_SERVER)
    def foo():
        return 'foo fallback'

    assert foo() == 'pong'


def test_fallback():

    @cdj.call(server=BAD_SERVER)
    def bar():
        return 'bar fallback'

    assert bar() == 'bar fallback'
