Skip to content

Commit c7bc942

Browse files
committed
fix(test): new keyspace not found behavior
integrates the new behavior for when the keyspace is not found in tests: raise instead of returning an `{:error, _}` tuple. Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
1 parent 439647f commit c7bc942

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

apps/astarte_realm_management/test/astarte_realm_management/engine_test.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,9 @@ defmodule Astarte.RealmManagement.EngineTest do
15691569
test "fail to retrieve datastream_maximum_storage_retention if realm does not exist" do
15701570
realm_name = "realm#{System.unique_integer([:positive])}"
15711571

1572-
assert {:error, _} =
1573-
Engine.get_datastream_maximum_storage_retention(realm_name)
1572+
assert_raise Xandra.Error, fn ->
1573+
Engine.get_datastream_maximum_storage_retention(realm_name)
1574+
end
15741575
end
15751576

15761577
defp unpack_source({:ok, source}) when is_binary(source) do

apps/astarte_realm_management/test/astarte_realm_management/queries_test.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,8 @@ defmodule Astarte.RealmManagement.QueriesTest do
875875
test "fail to retrieve datastream_maximum_storage_retention if realm does not exist" do
876876
realm_name = "realm#{System.unique_integer([:positive])}"
877877

878-
assert {:error, _} =
879-
Queries.get_datastream_maximum_storage_retention(realm_name)
878+
assert_raise Xandra.Error, fn ->
879+
Queries.get_datastream_maximum_storage_retention(realm_name)
880+
end
880881
end
881882
end

0 commit comments

Comments
 (0)