<commit_before>defmodule FarmbotOS.SysCalls.PointLookupTest do
  use ExUnit.Case
  use Mimic
  setup :verify_on_exit!
  alias FarmbotOS.SysCalls.PointLookup
  alias FarmbotOS.SysCalls.ResourceUpdate

  test "failure cases" do
    err1 = PointLookup.point("GenericPointer", 24)
    assert {:error, "GenericPointer not found"} == err1

    err2 = PointLookup.get_toolslot_for_tool(24)
    assert {:error, "Could not find point for tool by id: 24"} == err2

    err3 = PointLookup.get_point_group(24)
    assert {:error, "Could not find PointGroup.24"} == err3
  end
end<commit_msg>(40.8%) PointLookup.point/2<commit_after>defmodule FarmbotOS.SysCalls.PointLookupTest do
  use ExUnit.Case
  use Mimic
  setup :verify_on_exit!
  alias FarmbotOS.SysCalls.PointLookup
  alias FarmbotOS.SysCalls.ResourceUpdate
  alias FarmbotCore.Asset.Point
  alias FarmbotCore.Asset.Repo

  test "failure cases" do
    err1 = PointLookup.point("GenericPointer", 24)
    assert {:error, "GenericPointer not found"} == err1

    err2 = PointLookup.get_toolslot_for_tool(24)
    assert {:error, "Could not find point for tool by id: 24"} == err2

    err3 = PointLookup.get_point_group(24)
    assert {:error, "Could not find PointGroup.24"} == err3
  end

  test "PointLookup.point/2" do
    expected = %{
      name: "test suite III",
      x: 1.2,
      y: 3.4,
      z: 5.6
    }
   point = %Point{id: 555, pointer_type: "GenericPointer"}

    Map.merge(point, expected)
      |> Point.changeset()
      |> Repo.insert!()

    assert expected == PointLookup.point("GenericPointer", point.id)
  end
end
{'fraction_non_alphanumeric': 0.10942441492726122, 'fraction_numerical': 0.0290955091714105, 'mean_word_length': 3.652941176470588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2493170', 'n_tokens_mistral': 571, 'n_tokens_neox': 524, 'n_words': 134}