Пример #1
0
def test_in_memory_storage_get_next_when_no_projects():
    app = get_app()
    storage = InMemoryStorage(app)

    retrieved = storage.get_next_message()

    expect(retrieved).to_be_null()
Пример #2
0
def test_in_memory_storage_get_next_when_no_projects():
    app = get_app()
    storage = InMemoryStorage(app)

    retrieved = storage.get_next_message()

    expect(retrieved).to_be_null()
Пример #3
0
def test_in_memory_storage_get_next():
    app = get_app()
    storage = InMemoryStorage(app)

    msg = {"test": "test2"}

    storage.put(project_id=10, message=msg)

    retrieved = storage.get_next_message()

    expect(retrieved).to_be_like(msg)
Пример #4
0
def test_in_memory_storage_get_next():
    app = get_app()
    storage = InMemoryStorage(app)

    msg = {
        "test": "test2"
    }

    storage.put(project_id=10, message=msg)

    retrieved = storage.get_next_message()

    expect(retrieved).to_be_like(msg)
Пример #5
0
def test_in_memory_storage_get_next_when_empty():
    app = get_app()
    storage = InMemoryStorage(app)

    storage.put(project_id=20, message={
        "test": "test2"
    })

    storage.get_next_message()
    retrieved = storage.get_next_message()

    expect(retrieved).to_be_null()
Пример #6
0
def test_in_memory_storage_get_next_when_empty():
    app = get_app()
    storage = InMemoryStorage(app)

    storage.put(project_id=20, message={"test": "test2"})

    storage.get_next_message()
    retrieved = storage.get_next_message()

    expect(retrieved).to_be_null()
Пример #7
0
def test_in_memory_storage_putting_item():
    app = get_app()
    storage = InMemoryStorage(app)

    storage.put(project_id=10, message={"test": "test2"})

    storage.put(project_id=20, message={"test": "test2"})

    expect(storage.get_size(10)).to_equal(1)
    expect(storage.get_size(20)).to_equal(1)
    expect(storage.total_size).to_equal(2)
Пример #8
0
def test_in_memory_storage_putting_item():
    app = get_app()
    storage = InMemoryStorage(app)

    storage.put(project_id=10, message={
        "test": "test2"
    })

    storage.put(project_id=20, message={
        "test": "test2"
    })

    expect(storage.get_size(10)).to_equal(1)
    expect(storage.get_size(20)).to_equal(1)
    expect(storage.total_size).to_equal(2)