Skip to content

Commit adf4990

Browse files
committed
Fix some tests
1 parent fc0dcbc commit adf4990

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/src/store.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ pub struct Store {
1818
default_agent: Arc<Mutex<Option<crate::agents::Agent>>>,
1919
}
2020

21+
/// The URL used for stores that are not accessible on the web.
22+
pub const LOCAL_STORE_URL_STR: &str = "local:store";
23+
2124
lazy_static::lazy_static! {
22-
static ref LOCAL_STORE_URL: Url = Url::parse("local:store").unwrap();
25+
static ref LOCAL_STORE_URL: Url = Url::parse(LOCAL_STORE_URL_STR).unwrap();
2326
}
2427

2528
impl Store {

lib/src/storelike.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::{
88
errors::AtomicError,
99
hierarchy,
1010
schema::{Class, Property},
11+
store::LOCAL_STORE_URL_STR,
1112
values::query_value_compare,
1213
};
1314
use crate::{errors::AtomicResult, parse::parse_json_ad_string};
@@ -223,6 +224,9 @@ pub trait Storelike: Sized {
223224
/// the answer should always be `true`.
224225
fn is_external_subject(&self, subject: &str) -> AtomicResult<bool> {
225226
if let Some(self_url) = self.get_self_url() {
227+
if self_url.as_str() == LOCAL_STORE_URL_STR {
228+
return Ok(true);
229+
}
226230
if subject.starts_with(&self_url.as_str()) {
227231
return Ok(false);
228232
} else {

0 commit comments

Comments
 (0)