Skip to content

Commit de85b3a

Browse files
committed
imporve Agent/Graph Blobentry test
1 parent a8a2d28 commit de85b3a

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

src/DataBlobs/entities/BlobEntry.jl

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,6 @@ function Base.getproperty(x::Blobentry, f::Symbol)
113113
end
114114
end
115115

116-
function Base.setproperty!(x::Blobentry, f::Symbol, val)
117-
if f == :blobId
118-
@warn "Blobentry field :blobId has been renamed to :blobid"
119-
setfield!(x, :blobid, val)
120-
elseif f == :mimeType
121-
@warn "Blobentry field :mimeType has been renamed to :mimetype"
122-
setfield!(x, :mimetype, val)
123-
elseif f == :_version
124-
@warn "Blobentry field :_version has been renamed to :version"
125-
setfield!(x, :version, val)
126-
elseif f in [:id, :createdTimestamp, :lastUpdatedTimestamp, :hash]
127-
error("Blobentry field $f has been deprecated")
128-
else
129-
setfield!(x, f, val)
130-
end
131-
end
132-
133116
const Blobentries = OrderedDict{Symbol, Blobentry}
134117

135118
function StructUtils.lower(entries::Blobentries)

src/GraphsDFG/FactorGraphs/FactorGraphs.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ has_vertex(g::FactorGraph, x...) = has_vertex(g.graph, x...)
9595
inneighbors(g::FactorGraph, v::Integer) = inneighbors(g.graph, v)
9696
outneighbors(g::FactorGraph, v::Integer) = fadj(g.graph, v)
9797

98-
is_directed(::Type{FactorGraph}) = false
99-
is_directed(::Type{FactorGraph{T, V, F}}) where {T, V, F} = false
98+
is_directed(::Type{<:FactorGraph}) = false
10099
is_directed(g::FactorGraph) = false
101100

102101
Base.zero(g::FactorGraph{T, V, F}) where {T, V, F} = FactorGraph{T, V, F}(0, 0)

test/testBlocks.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ function GraphAgentBlobentries!(fg::AbstractDFG)
184184
@test hasAgentBlobentry(fg, :key1) == false
185185
@test_throws DFG.LabelNotFoundError getAgentBlobentry(fg, :key1)
186186
@test_throws DFG.LabelNotFoundError deleteAgentBlobentry!(fg, :key1)
187+
@test addAgentBlobentries!(fg, [be]) == [be]
188+
@test deleteAgentBlobentries!(fg, [:key1]) == 1
189+
@test mergeAgentBlobentries!(fg, [be]) == 1
190+
@test deleteAgentBlobentries!(fg, [:key1]) == 1
187191

188192
# Graph Blob Entries
189193
ae = addGraphBlobentry!(fg, be)
@@ -199,6 +203,10 @@ function GraphAgentBlobentries!(fg::AbstractDFG)
199203
@test hasGraphBlobentry(fg, :key1) == false
200204
@test_throws DFG.LabelNotFoundError getGraphBlobentry(fg, :key1)
201205
@test_throws DFG.LabelNotFoundError deleteGraphBlobentry!(fg, :key1)
206+
@test addGraphBlobentries!(fg, [be]) == [be]
207+
@test deleteGraphBlobentries!(fg, [:key1]) == 1
208+
@test mergeGraphBlobentries!(fg, [be]) == 1
209+
@test deleteGraphBlobentries!(fg, [:key1]) == 1
202210

203211
be2 = Blobentry(; blobid = uuid4(), label = :key2, blobstore = :b)
204212

0 commit comments

Comments
 (0)