示例#1
0
async def test_write_device():
    """Test writing device."""
    out = io.StringIO()
    device = apns.ApnsDevice("123", "name", "track_id", True)

    apns._write_device(out, device)
    data = yaml.safe_load(out.getvalue())
    assert data == {
        123: {"name": "name", "tracking_device_id": "track_id", "disabled": True}
    }
示例#2
0
def test_write_device():
    """Test writing device."""
    out = io.StringIO()
    device = apns.ApnsDevice('123', 'name', 'track_id', True)

    apns._write_device(out, device)
    data = yaml.safe_load(out.getvalue())
    assert data == {
        123: {
            'name': 'name',
            'tracking_device_id': 'track_id',
            'disabled': True
        },
    }
示例#3
0
def test_write_device():
    """Test writing device."""
    out = io.StringIO()
    device = apns.ApnsDevice('123', 'name', 'track_id', True)

    apns._write_device(out, device)
    data = yaml.load(out.getvalue())
    assert data == {
        123: {
            'name': 'name',
            'tracking_device_id': 'track_id',
            'disabled': True
        },
    }