Merge pull request #12 from StevanFreeborn/stevanfreeborn/tests/fix-image-test [skip ci]

tests: stop git from messing up image file
This commit is contained in:
Stevan Freeborn
2024-07-19 22:49:42 -05:00
committed by GitHub
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -1,3 +1,4 @@
* text eol=crlf * text eol=crlf
*.woff binary *.woff binary
*.woff2 binary *.woff2 binary
*.jpg binary
@@ -63,9 +63,10 @@ public class ClientTests(ConfigurationFixture configFixture) : EndToEndTest(conf
[Fact] [Fact]
public async Task CreateMessageAsync_WhenImageIsSent_ItShouldReturnResponse() public async Task CreateMessageAsync_WhenImageIsSent_ItShouldReturnResponse()
{ {
var imagePath = Path.Combine(Directory.GetCurrentDirectory(), "Files", "base64-elephant.txt"); var imagePath = Path.Combine(Directory.GetCurrentDirectory(), "Files", "elephant.jpg");
var mediaType = "image/jpeg"; var mediaType = "image/jpeg";
var base64Data = await File.ReadAllTextAsync(imagePath); var bytes = await File.ReadAllBytesAsync(imagePath);
var base64Data = Convert.ToBase64String(bytes);
var request = new MessageRequest( var request = new MessageRequest(
model: AnthropicModels.Claude3Haiku, model: AnthropicModels.Claude3Haiku,
File diff suppressed because one or more lines are too long