Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_to_pandas_empty(products):
df = SentinelAPI.to_dataframe({})
assert type(df).__name__ == 'DataFrame'
assert len(df) == 0
def test_missing_dependency_dataframe(monkeypatch):
with pytest.raises(ImportError):
monkeypatch.setitem(sys.modules, "pandas", None)
SentinelAPI.to_dataframe({"test": "test"})
def test_to_pandas(products):
df = SentinelAPI.to_dataframe(products)
assert type(df).__name__ == "DataFrame"
assert len(products) == len(df)
assert set(products) == set(df.index)
def test_to_pandas(products):
df = SentinelAPI.to_dataframe(products)
assert type(df).__name__ == 'DataFrame'
assert len(products) == len(df)
assert set(products) == set(df.index)
def test_to_pandas_empty():
df = SentinelAPI.to_dataframe({})
assert type(df).__name__ == "DataFrame"
assert len(df) == 0