mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
drop plus_one test
This commit is contained in:
parent
12c60f20fe
commit
bead03e858
4 changed files with 0 additions and 18 deletions
|
@ -16,8 +16,6 @@ message BackendInput {
|
||||||
BrowserRowsIn browser_rows = 20;
|
BrowserRowsIn browser_rows = 20;
|
||||||
RenderCardIn render_card = 21;
|
RenderCardIn render_card = 21;
|
||||||
int64 local_minutes_west = 22;
|
int64 local_minutes_west = 22;
|
||||||
|
|
||||||
PlusOneIn plus_one = 2046; // temporary, for testing
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +29,6 @@ message BackendOutput {
|
||||||
RenderCardOut render_card = 21;
|
RenderCardOut render_card = 21;
|
||||||
sint32 local_minutes_west = 22;
|
sint32 local_minutes_west = 22;
|
||||||
|
|
||||||
PlusOneOut plus_one = 2046; // temporary, for testing
|
|
||||||
|
|
||||||
BackendError error = 2047;
|
BackendError error = 2047;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,11 +88,6 @@ class RustBackend:
|
||||||
else:
|
else:
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def plus_one(self, num: int) -> int:
|
|
||||||
input = pb.BackendInput(plus_one=pb.PlusOneIn(num=num))
|
|
||||||
output = self._run_command(input)
|
|
||||||
return output.plus_one.num
|
|
||||||
|
|
||||||
def template_requirements(
|
def template_requirements(
|
||||||
self, template_fronts: List[str], field_map: Dict[str, int]
|
self, template_fronts: List[str], field_map: Dict[str, int]
|
||||||
) -> AllTemplateReqs:
|
) -> AllTemplateReqs:
|
||||||
|
|
|
@ -31,9 +31,6 @@ def Collection(
|
||||||
) -> _Collection:
|
) -> _Collection:
|
||||||
"Open a new or existing collection. Path must be unicode."
|
"Open a new or existing collection. Path must be unicode."
|
||||||
backend = RustBackend(path)
|
backend = RustBackend(path)
|
||||||
# fixme: this call is temporarily here to ensure the brige is working
|
|
||||||
# on all platforms, and should be removed in a future beta
|
|
||||||
assert backend.plus_one(5) == 6
|
|
||||||
assert path.endswith(".anki2")
|
assert path.endswith(".anki2")
|
||||||
path = os.path.abspath(path)
|
path = os.path.abspath(path)
|
||||||
create = not os.path.exists(path)
|
create = not os.path.exists(path)
|
||||||
|
|
|
@ -88,7 +88,6 @@ impl Backend {
|
||||||
Value::TemplateRequirements(input) => {
|
Value::TemplateRequirements(input) => {
|
||||||
OValue::TemplateRequirements(self.template_requirements(input)?)
|
OValue::TemplateRequirements(self.template_requirements(input)?)
|
||||||
}
|
}
|
||||||
Value::PlusOne(input) => OValue::PlusOne(self.plus_one(input)?),
|
|
||||||
Value::SchedTimingToday(input) => {
|
Value::SchedTimingToday(input) => {
|
||||||
OValue::SchedTimingToday(self.sched_timing_today(input))
|
OValue::SchedTimingToday(self.sched_timing_today(input))
|
||||||
}
|
}
|
||||||
|
@ -102,11 +101,6 @@ impl Backend {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn plus_one(&self, input: pt::PlusOneIn) -> Result<pt::PlusOneOut> {
|
|
||||||
let num = input.num + 1;
|
|
||||||
Ok(pt::PlusOneOut { num })
|
|
||||||
}
|
|
||||||
|
|
||||||
fn template_requirements(
|
fn template_requirements(
|
||||||
&self,
|
&self,
|
||||||
input: pt::TemplateRequirementsIn,
|
input: pt::TemplateRequirementsIn,
|
||||||
|
|
Loading…
Reference in a new issue