<reponame>ClinGen/gene-and-variant-curation-tools<filename>gci-vci-serverless/tests/unit/test_ddb_update_expression_builder.py
import pytest

from src.db.ddb_client import UpdateExpressionBuilder

def test_builds_set_expression():
  test_builder = UpdateExpressionBuilder()
  test_builder.append_set('foo')
  test_builder.append_set('bar')
  
  act_expression = test_builder.build_expression()
  assert act_expression == 'SET #foo = :foo, #bar = :bar'

def test_builds_remove_expression():
  test_builder = UpdateExpressionBuilder()
  test_builder.append_remove('foo')
  test_builder.append_remove('bar')
  
  act_expression = test_builder.build_expression()
  assert act_expression == 'REMOVE #foo, #bar'

def test_builds_multiple_action_expression():
  test_builder = UpdateExpressionBuilder()
  test_builder.append_set('foo')
  test_builder.append_set('bar')
  test_builder.append_remove('foobar')
  
  act_expression = test_builder.build_expression()
  assert act_expression == 'SET #foo = :foo, #bar = :bar REMOVE #foobar'

import pytest

from src.db.ddb_client import UpdateExpressionBuilder

def test_builds_set_expression():
  test_builder = UpdateExpressionBuilder()
  test_builder.append_set('foo')
  test_builder.append_set('bar')
  
  act_expression = test_builder.build_expression()
  assert act_expression == 'SET #foo = :foo, #bar = :bar'

def test_builds_remove_expression():
  test_builder = UpdateExpressionBuilder()
  test_builder.append_remove('foo')
  test_builder.append_remove('bar')
  
  act_expression = test_builder.build_expression()
  assert act_expression == 'REMOVE #foo, #bar'

def test_builds_multiple_action_expression():
  test_builder = UpdateExpressionBuilder()
  test_builder.append_set('foo')
  test_builder.append_set('bar')
  test_builder.append_remove('foobar')
  
  act_expression = test_builder.build_expression()
  assert act_expression == 'SET #foo = :foo, #bar = :bar REMOVE #foobar'
#foo = :foo, #bar = :bar' #foo, #bar' #foo = :foo, #bar = :bar REMOVE #foobar'